add Smartfile.parsedPath

This commit is contained in:
2017-05-07 23:00:56 +02:00
parent 5493d3cd5d
commit 30bc489822
5 changed files with 35 additions and 19 deletions

View File

@ -17,6 +17,11 @@ export class Smartfile {
*/
path: string
/**
*
*/
parsedPath: plugins.path.ParsedPath
/**
* the content of the file as Buffer
*/
@ -24,6 +29,7 @@ export class Smartfile {
/**
* The current working directory of the file
* Note:this is similar to gulp and different from native node path base
*/
base: string
@ -36,6 +42,8 @@ export class Smartfile {
* the constructor of Smartfile
* @param optionsArg
*/
constructor (optionsArg: ISmartfileConstructorOptions) {
if (optionsArg.contentBuffer) {
this.contentBuffer = optionsArg.contentBuffer
@ -45,6 +53,7 @@ export class Smartfile {
console.log('created empty Smartfile?')
}
this.path = optionsArg.path
this.parsedPath = plugins.path.parse(this.path)
this.base = optionsArg.base
}