New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@agoric/internal

Package Overview
Dependencies
Maintainers
0
Versions
1945
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/internal - npm Package Compare versions

Comparing version 0.4.0-upgrade-19-dev-0754752.0 to 0.4.0-upgrade-19-dev-6f73842.0

8

package.json
{
"name": "@agoric/internal",
"version": "0.4.0-upgrade-19-dev-0754752.0+0754752",
"version": "0.4.0-upgrade-19-dev-6f73842.0+6f73842",
"description": "Externally unsupported utilities internal to agoric-sdk",

@@ -23,3 +23,3 @@ "type": "module",

"dependencies": {
"@agoric/base-zone": "0.1.1-upgrade-19-dev-0754752.0+0754752",
"@agoric/base-zone": "0.1.1-upgrade-19-dev-6f73842.0+6f73842",
"@endo/common": "^1.2.9",

@@ -38,3 +38,3 @@ "@endo/errors": "^1.2.9",

"devDependencies": {
"@agoric/cosmic-proto": "0.5.0-upgrade-19-dev-0754752.0+0754752",
"@agoric/cosmic-proto": "0.5.0-upgrade-19-dev-6f73842.0+6f73842",
"@endo/exo": "^1.5.8",

@@ -65,3 +65,3 @@ "@endo/init": "^1.1.8",

},
"gitHead": "07547522e9d8a06692fa5ff12c35230ddb4b252b"
"gitHead": "6f73842af496b44e61731f3beaf81767d8ea08dd"
}

@@ -1,4 +0,4 @@

import { createWriteStream } from 'node:fs';
import { open } from 'node:fs/promises';
import process from 'node:process';
import { open } from 'node:fs/promises';
import { promisify } from 'node:util';

@@ -43,6 +43,2 @@ /**

const noPath = /** @type {import('fs').PathLike} */ (
/** @type {unknown} */ (undefined)
);
/** @typedef {NonNullable<Awaited<ReturnType<typeof makeFsStreamWriter>>>} FsStreamWriter */

@@ -55,8 +51,18 @@ /** @param {string | undefined | null} filePath */

const handle = await (filePath !== '-' ? open(filePath, 'a') : undefined);
const stream = handle
? createWriteStream(noPath, { fd: handle.fd })
: process.stdout;
const useStdout = filePath === '-';
const { handle, stream } = await (async () => {
if (useStdout) {
return { handle: undefined, stream: process.stdout };
}
const fh = await open(filePath, 'a');
return { handle: fh, stream: fh.createWriteStream({ flush: true }) };
})();
await fsStreamReady(stream);
const writeAsync = promisify(stream.write.bind(stream));
const closeAsync =
useStdout || !(/** @type {any} */ (stream).close)
? undefined
: promisify(
/** @type {import('fs').WriteStream} */ (stream).close.bind(stream),
);

@@ -82,16 +88,10 @@ let flushed = Promise.resolve();

const write = async data => {
/** @type {Promise<void>} */
const written = closed
? Promise.reject(Error('Stream closed'))
: new Promise((resolve, reject) => {
stream.write(data, err => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
: writeAsync(data);
updateFlushed(written);
return written;
const waitForDrain = await written;
if (waitForDrain) {
await new Promise(resolve => stream.once('drain', resolve));
}
};

@@ -113,4 +113,3 @@

await flush();
// @ts-expect-error calling a possibly missing method
stream.close?.();
await closeAsync?.();
};

@@ -117,0 +116,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc