fix(core): update

This commit is contained in:
Philipp Kunz 2021-12-01 10:47:29 +01:00
parent b12de7aed4
commit 9c614bd2f3

View File

@ -77,8 +77,16 @@ export class Smartfile extends plugins.smartjson.Smartjson {
/** /**
* a parsed path * a parsed path
*/ */
@plugins.smartjson.foldDec() public get parsedPath (): plugins.path.ParsedPath {
public parsedPath: plugins.path.ParsedPath; return plugins.path.parse(this.path);
};
public get absolutePath () {
return plugins.path.join(this.base, this.path);
}
public get absoluteParsedPath() {
return plugins.path.parse(this.absolutePath);
}
/** /**
* the content of the file as Buffer * the content of the file as Buffer
@ -112,18 +120,9 @@ export class Smartfile extends plugins.smartjson.Smartjson {
console.log('created empty Smartfile?'); console.log('created empty Smartfile?');
} }
this.path = optionsArg.path; this.path = optionsArg.path;
this.parsedPath = plugins.path.parse(this.path);
this.base = optionsArg.base; this.base = optionsArg.base;
} }
public getAbsolutePath () {
return plugins.path.join(this.base, this.path);
}
public getAbsoluteParsedPath() {
return plugins.path.parse(this.getAbsolutePath());
}
/** /**
* set contents from string * set contents from string
* @param contentString * @param contentString