Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b2482ab8a5 | |||
9c614bd2f3 | |||
b12de7aed4 | |||
d6eb54d21c |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartfile",
|
||||
"version": "9.0.0",
|
||||
"version": "9.0.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartfile",
|
||||
"version": "9.0.0",
|
||||
"version": "9.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile-interfaces": "^1.0.7",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@pushrocks/smartfile",
|
||||
"private": false,
|
||||
"version": "9.0.0",
|
||||
"version": "9.0.2",
|
||||
"description": "offers smart ways to work with files in nodejs",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
@ -69,7 +69,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
// INSTANCE
|
||||
// ========
|
||||
/**
|
||||
* the full path of the file on disk
|
||||
* the relative path of the file
|
||||
*/
|
||||
@plugins.smartjson.foldDec()
|
||||
public path: string;
|
||||
@ -77,8 +77,16 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
/**
|
||||
* a parsed path
|
||||
*/
|
||||
@plugins.smartjson.foldDec()
|
||||
public parsedPath: plugins.path.ParsedPath;
|
||||
public get 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
|
||||
@ -112,7 +120,6 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
console.log('created empty Smartfile?');
|
||||
}
|
||||
this.path = optionsArg.path;
|
||||
this.parsedPath = plugins.path.parse(this.path);
|
||||
this.base = optionsArg.base;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user