improve creation of Smartfiles

This commit is contained in:
2017-04-30 15:12:35 +02:00
parent 531f169c11
commit 97bf5ff74b
3 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@ export interface ISmartfileConstructorOptions {
path?: string
contentString?: string
contentBuffer?: Buffer
cwd?: string
}
/**
@ -45,11 +46,13 @@ export class Smartfile {
this.contentBuffer = optionsArg.contentBuffer
this.contents = optionsArg.contentBuffer
} else if (optionsArg.contentString) {
this.contentBuffer = optionsArg.contentBuffer
this.contents = Buffer.from(optionsArg.contentString)
} else {
console.log('created empty Smartfile?')
}
this.path = optionsArg.path
this.cwd = optionsArg.cwd
}
/**