@yarnpkg/fslib
Advanced tools
Comparing version 2.0.0-rc.8 to 2.0.0-rc.11
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tmp_1 = __importDefault(require("tmp")); | ||
const NodeFS_1 = require("./NodeFS"); | ||
@@ -113,3 +109,3 @@ const path_1 = require("./path"); | ||
fakeFs.readPromise(p, buffer, ...args).then(bytesRead => { | ||
callback(undefined, bytesRead, buffer); | ||
callback(null, bytesRead, buffer); | ||
}, error => { | ||
@@ -128,3 +124,3 @@ callback(error); | ||
fakeImpl(...args).then((result) => { | ||
callback(undefined, result); | ||
callback(null, result); | ||
}, (error) => { | ||
@@ -153,3 +149,9 @@ callback(error); | ||
mktempSync(cb) { | ||
const { name, removeCallback } = tmp_1.default.dirSync({ unsafeCleanup: true }); | ||
// We lazily load `tmp` because it injects itself into the `process` | ||
// events (to clean the folders at exit time), and it may lead to | ||
// large memory leaks. Better avoid loading it until we can't do | ||
// otherwise (ideally the fix would be for `tmp` itself to only | ||
// attach cleaners after the first call). | ||
const tmp = require(`tmp`); | ||
const { name, removeCallback } = tmp.dirSync({ unsafeCleanup: true }); | ||
if (typeof cb === `undefined`) { | ||
@@ -168,5 +170,11 @@ return path_1.npath.toPortablePath(name); | ||
mktempPromise(cb) { | ||
// We lazily load `tmp` because it injects itself into the `process` | ||
// events (to clean the folders at exit time), and it may lead to | ||
// large memory leaks. Better avoid loading it until we can't do | ||
// otherwise (ideally the fix would be for `tmp` itself to only | ||
// attach cleaners after the first call). | ||
const tmp = require(`tmp`); | ||
if (typeof cb === `undefined`) { | ||
return new Promise((resolve, reject) => { | ||
tmp_1.default.dir({ unsafeCleanup: true }, (err, path) => { | ||
tmp.dir({ unsafeCleanup: true }, (err, path) => { | ||
if (err) { | ||
@@ -183,3 +191,3 @@ reject(err); | ||
return new Promise((resolve, reject) => { | ||
tmp_1.default.dir({ unsafeCleanup: true }, (err, path, cleanup) => { | ||
tmp.dir({ unsafeCleanup: true }, (err, path, cleanup) => { | ||
if (err) { | ||
@@ -186,0 +194,0 @@ reject(err); |
{ | ||
"name": "@yarnpkg/fslib", | ||
"version": "2.0.0-rc.8", | ||
"version": "2.0.0-rc.11", | ||
"main": "./lib/index.js", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@yarnpkg/libzip": "2.0.0-rc.3", | ||
"tmp": "^0.0.33" | ||
"@yarnpkg/libzip": "2.0.0-rc.5", | ||
"tmp": "^0.1.0" | ||
}, | ||
"scripts": { | ||
"postpack": "rm -rf lib", | ||
"prepack": "mkdir -p lib && rsync -a --exclude '*.ts' sources/ lib/ && run build:compile packages/yarnpkg-fslib", | ||
"prepack": "run build:compile \"$(pwd)\"", | ||
"release": "yarn npm publish", | ||
@@ -14,0 +14,0 @@ "test:fslib": "run test:unit packages/yarnpkg-fslib", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
141440
3585
5
+ Added@yarnpkg/libzip@2.0.0-rc.5(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedtmp@0.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removed@yarnpkg/libzip@2.0.0-rc.3(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedtmp@0.0.33(transitive)
Updated@yarnpkg/libzip@2.0.0-rc.5
Updatedtmp@^0.1.0