From ddb6488bf25b403e2127a4ceb406b37e3a949178 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sat, 30 Mar 2024 18:24:58 -0700 Subject: [PATCH] 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. 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' /**