Comparing version 3.3.3 to 3.3.4
@@ -9,6 +9,6 @@ "use strict"; | ||
function _bluebirdLst() { | ||
const data = _interopRequireDefault(require("bluebird-lst")); | ||
function _fsExtra() { | ||
const data = require("fs-extra"); | ||
_bluebirdLst = function () { | ||
_fsExtra = function () { | ||
return data; | ||
@@ -20,12 +20,2 @@ }; | ||
function _fsExtraP() { | ||
const data = require("fs-extra-p"); | ||
_fsExtraP = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _os() { | ||
@@ -45,4 +35,2 @@ const data = require("os"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
let tmpFileCounter = 0; | ||
@@ -71,3 +59,3 @@ const tmpDirManagers = new Set(); // add date to avoid use stale temp dir | ||
const isEnsureRemovedOnExit = process.env.TMP_DIR_MANAGER_ENSURE_REMOVED_ON_EXIT !== "false"; | ||
tempDirPromise = (0, _fsExtraP().mkdtemp)(path.join(systemTmpDir, "t-")).then(it => (0, _fsExtraP().realpath)(it)).then(dir => { | ||
tempDirPromise = (0, _fsExtra().mkdtemp)(path.join(systemTmpDir, "t-")).then(it => (0, _fsExtra().realpath)(it)).then(dir => { | ||
if (isEnsureRemovedOnExit) { | ||
@@ -94,3 +82,3 @@ addExitHook(dir); | ||
try { | ||
(0, _fsExtraP().removeSync)(dir); | ||
(0, _fsExtra().removeSync)(dir); | ||
} catch (e) { | ||
@@ -101,6 +89,5 @@ handleError(e, dir); | ||
return; | ||
} // each instead of map to avoid fs overload | ||
} | ||
_bluebirdLst().default.each(managers, it => it.cleanup()).then(() => (0, _fsExtraP().remove)(dir)).then(() => callback()).catch(e => { | ||
Promise.all(managers.map(it => it.cleanup())).then(() => (0, _fsExtra().remove)(dir)).then(() => callback()).catch(e => { | ||
try { | ||
@@ -139,3 +126,3 @@ handleError(e, dir); | ||
createTempDir(options) { | ||
return this.getTempFile(options, true).then(it => (0, _fsExtraP().ensureDir)(it).then(() => it)); | ||
return this.getTempFile(options, true).then(it => (0, _fsExtra().ensureDir)(it).then(() => it)); | ||
} | ||
@@ -184,5 +171,5 @@ | ||
if (file.isDir) { | ||
(0, _fsExtraP().removeSync)(file.path); | ||
(0, _fsExtra().removeSync)(file.path); | ||
} else { | ||
(0, _fsExtraP().unlinkSync)(file.path); | ||
(0, _fsExtra().unlinkSync)(file.path); | ||
} | ||
@@ -215,6 +202,6 @@ } catch (e) { | ||
tempDirPromise = null; | ||
return (0, _fsExtraP().remove)(dir); | ||
return (0, _fsExtra().remove)(dir); | ||
} | ||
return _bluebirdLst().default.map(tempFiles, it => { | ||
return Promise.all(tempFiles.map(it => { | ||
if (it.disposer != null) { | ||
@@ -224,8 +211,6 @@ return it.disposer(it.path); | ||
return (it.isDir ? (0, _fsExtraP().remove)(it.path) : (0, _fsExtraP().unlink)(it.path)).catch(e => { | ||
return (it.isDir ? (0, _fsExtra().remove)(it.path) : (0, _fsExtra().unlink)(it.path)).catch(e => { | ||
handleError(e, it.path); | ||
}); | ||
}, { | ||
concurrency: 4 | ||
}); | ||
})); | ||
} | ||
@@ -232,0 +217,0 @@ |
{ | ||
"name": "temp-file", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"main": "out/main.js", | ||
@@ -15,19 +15,19 @@ "author": "Vladimir Krivosheev", | ||
"compile": "ts-babel", | ||
"release": "BABEL_ENV=production yarn compile && npm publish" | ||
"release": "yarn compile && npm publish" | ||
}, | ||
"dependencies": { | ||
"async-exit-hook": "^2.0.1", | ||
"bluebird-lst": "^1.0.9", | ||
"fs-extra-p": "^8.0.2" | ||
"fs-extra": "^8.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/fs-extra": "^8.0.0", | ||
"@types/js-yaml": "^3.12.1", | ||
"@types/node": "^12.0.7", | ||
"babel-preset-ts-node6-bluebird": "^3.0.2", | ||
"ts-babel": "^6.1.4", | ||
"typescript": "^3.5.1" | ||
"@types/node": "^12.6.0", | ||
"babel-preset-ts-node8": "^4.0.0", | ||
"ts-babel": "^6.1.7", | ||
"typescript": "^3.5.2" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"babel-preset-ts-node6-bluebird" | ||
"babel-preset-ts-node8" | ||
] | ||
@@ -34,0 +34,0 @@ }, |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
0
17851
6
5
192
+ Addedfs-extra@^8.1.0
- Removedbluebird-lst@^1.0.9
- Removedfs-extra-p@^8.0.2
- Removedbluebird@3.7.2(transitive)
- Removedbluebird-lst@1.0.9(transitive)
- Removedfs-extra-p@8.1.0(transitive)