Comparing version 2.0.0 to 2.0.1
export declare function getTempName(prefix?: string | null | undefined): string; | ||
export interface GetTempFileOptions { | ||
disposer: ((file: string) => Promise<void>) | null; | ||
disposer?: ((file: string) => Promise<void>) | null; | ||
prefix?: string | null; | ||
isDir?: boolean; | ||
} | ||
@@ -11,5 +12,5 @@ export declare class TmpDir { | ||
createTempDir(suffix?: string): Promise<string>; | ||
getTempFile(suffix: string | null, isDir?: boolean, options?: GetTempFileOptions): Promise<string>; | ||
getTempFile(suffix: string | null, options?: GetTempFileOptions): Promise<string>; | ||
cleanupSync(): void; | ||
cleanup(): Promise<any>; | ||
} |
@@ -88,2 +88,3 @@ "use strict"; | ||
} | ||
const IS_DIR_OPTIONS = { isDir: true }; | ||
class TmpDir { | ||
@@ -97,3 +98,3 @@ constructor() { | ||
return this.getTempFile(suffix, true); | ||
return this.getTempFile(suffix, IS_DIR_OPTIONS); | ||
} | ||
@@ -103,8 +104,5 @@ createTempDir() { | ||
return this.getTempFile(suffix, true).then(it => (0, (_fsExtraP || _load_fsExtraP()).mkdir)(it).then(() => it)); | ||
return this.getTempFile(suffix, IS_DIR_OPTIONS).then(it => (0, (_fsExtraP || _load_fsExtraP()).mkdir)(it).then(() => it)); | ||
} | ||
getTempFile(suffix) { | ||
let isDir = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
let options = arguments[2]; | ||
getTempFile(suffix, options) { | ||
return tempDir.value.then(it => { | ||
@@ -120,3 +118,3 @@ if (!this.registered) { | ||
path: result, | ||
isDir, | ||
isDir: options != null && options.isDir === true, | ||
disposer: options == null ? null : options.disposer | ||
@@ -123,0 +121,0 @@ }); |
{ | ||
"name": "temp-file", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "out/main.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
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
17823