From dce3359124b1b8f903ce2e6d4da061261bfe8f08 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sat, 30 Mar 2024 18:24:58 -0700 Subject: [PATCH 1/2] fix: use `node:`-prefixed requires for builtins This changeset fixes and closes isaacs/path-scurry#16 so that this package can be used on all JS runtimes. Relates to isaacs/node-glob#580 Signed-off-by: Sam Gammon --- src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 01f794f..97a6d8e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ import { LRUCache } from 'lru-cache' -import { posix, win32 } from 'path' +import { posix, win32 } from 'node:path' -import { fileURLToPath } from 'url' +import { fileURLToPath } from 'node:url' -import * as actualFS from 'fs' +import * as actualFS from 'node:fs' import { lstatSync, readdir as readdirCB, @@ -14,9 +14,9 @@ import { const realpathSync = rps.native // TODO: test perf of fs/promises realpath vs realpathCB, // since the promises one uses realpath.native -import { lstat, readdir, readlink, realpath } from 'fs/promises' +import { lstat, readdir, readlink, realpath } from 'node:fs/promises' -import type { Dirent, Stats } from 'fs' +import type { Dirent, Stats } from 'node:fs' import { Minipass } from 'minipass' /** From cf46650ac229c4bfb9083bc4d5509981b1c6bbde Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sat, 30 Mar 2024 18:25:56 -0700 Subject: [PATCH 2/2] fix: medium-severity advisory in `word-wrap` Runs `npm audit fix` to remedy: `word-wrap` vulnerable to Regular Expression Denial GHSA-j8xg-fqg3-53r7 Signed-off-by: Sam Gammon --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72ae137..a7d3380 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5449,9 +5449,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "peer": true, "engines": {