@agoric/internal
Advanced tools
Comparing version 0.2.1-dev-7165dea.0 to 0.2.1-dev-a27d71d.0
{ | ||
"name": "@agoric/internal", | ||
"version": "0.2.1-dev-7165dea.0+7165dea", | ||
"version": "0.2.1-dev-a27d71d.0+a27d71d", | ||
"description": "Externally unsupported utilities internal to agoric-sdk", | ||
@@ -21,8 +21,8 @@ "type": "module", | ||
"dependencies": { | ||
"@endo/eventual-send": "^0.16.4", | ||
"@endo/marshal": "^0.7.4", | ||
"@endo/promise-kit": "^0.2.48" | ||
"@endo/eventual-send": "^0.16.5", | ||
"@endo/marshal": "^0.7.5", | ||
"@endo/promise-kit": "^0.2.49" | ||
}, | ||
"devDependencies": { | ||
"@endo/init": "^0.5.48", | ||
"@endo/init": "^0.5.49", | ||
"ava": "^4.3.1" | ||
@@ -38,3 +38,3 @@ }, | ||
}, | ||
"gitHead": "7165deabc5a6bfef04bb7da4baa3bfcee191ee02" | ||
"gitHead": "a27d71dc7f002c919626b63117078e1c54543c42" | ||
} |
@@ -231,3 +231,3 @@ // @ts-check | ||
*/ | ||
const makeAggregateError = (errors, message) => { | ||
export const makeAggregateError = (errors, message) => { | ||
const err = new Error(message); | ||
@@ -283,1 +283,37 @@ Object.defineProperties(err, { | ||
); | ||
/** | ||
* @param {import("fs").ReadStream | import("fs").WriteStream} stream | ||
* @returns {Promise<void>} | ||
*/ | ||
export const fsStreamReady = stream => | ||
new Promise((resolve, reject) => { | ||
if (stream.destroyed) { | ||
reject(new Error('Stream already destroyed')); | ||
return; | ||
} | ||
if (!stream.pending) { | ||
resolve(); | ||
return; | ||
} | ||
const onReady = () => { | ||
cleanup(); // eslint-disable-line no-use-before-define | ||
resolve(); | ||
}; | ||
/** @param {Error} err */ | ||
const onError = err => { | ||
cleanup(); // eslint-disable-line no-use-before-define | ||
reject(err); | ||
}; | ||
const cleanup = () => { | ||
stream.off('ready', onReady); | ||
stream.off('error', onError); | ||
}; | ||
stream.on('ready', onReady); | ||
stream.on('error', onError); | ||
}); |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
25148
322
Updated@endo/eventual-send@^0.16.5
Updated@endo/marshal@^0.7.5
Updated@endo/promise-kit@^0.2.49