Comparing version 1.10.1 to 1.11.0
@@ -7,2 +7,7 @@ /// <reference types="node" /> | ||
exists(sourcePath: string): Promise<boolean>; | ||
dirname(sourcePath: string): string; | ||
basename(sourcePath: string): string; | ||
join(...paths: string[]): string; | ||
extname(sourcePath: string): string; | ||
move(sourcePath: string, destPath: string): Promise<void>; | ||
create(sourcePath: string): Promise<void>; | ||
@@ -9,0 +14,0 @@ resolve(source: string): string; |
@@ -41,2 +41,26 @@ "use strict"; | ||
} | ||
dirname(sourcePath) { | ||
return path_1.default.dirname(sourcePath); | ||
} | ||
basename(sourcePath) { | ||
return path_1.default.basename(sourcePath); | ||
} | ||
join(...paths) { | ||
return path_1.default.join(...paths); | ||
} | ||
extname(sourcePath) { | ||
return path_1.default.extname(sourcePath); | ||
} | ||
move(sourcePath, destPath) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _sourcePath = this.resolve(sourcePath); | ||
const _destPath = this.resolve(destPath); | ||
if (!(yield this.exists(_sourcePath))) { | ||
throw new Error(`not exists ${sourcePath}`); | ||
} | ||
return new Promise((resolve, reject) => { | ||
fs_1.default.rename(_sourcePath, _destPath, err => err ? reject(err) : resolve()); | ||
}); | ||
}); | ||
} | ||
create(sourcePath) { | ||
@@ -43,0 +67,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "h3lp", | ||
"version": "1.10.1", | ||
"version": "1.11.0", | ||
"description": "Helper for nodeJs", | ||
@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@hotmail.com>", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
229265
2966