Comparing version 5.0.5 to 5.0.6
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import fs, { Dirent } from 'fs'; | ||
@@ -2,0 +3,0 @@ export { chmodSync, mkdirSync, renameSync, rmdirSync, rmSync, statSync, lstatSync, unlinkSync, } from 'fs'; |
@@ -29,3 +29,3 @@ "use strict"; | ||
const readdir = (path) => new Promise((res, rej) => fs_1.default.readdir(path, { withFileTypes: true }, (er, data) => er ? rej(er) : res(data))); | ||
const rename = (oldPath, newPath) => new Promise((res, rej) => fs_1.default.rename(oldPath, newPath, (er, ...d) => (er ? rej(er) : res(...d)))); | ||
const rename = (oldPath, newPath) => new Promise((res, rej) => fs_1.default.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d))); | ||
const rm = (path, options) => new Promise((res, rej) => fs_1.default.rm(path, options, (er, ...d) => (er ? rej(er) : res(...d)))); | ||
@@ -32,0 +32,0 @@ const rmdir = (path) => new Promise((res, rej) => fs_1.default.rmdir(path, (er, ...d) => (er ? rej(er) : res(...d)))); |
import { RimrafAsyncOptions, RimrafSyncOptions } from './opt-arg.js'; | ||
export { assertRimrafOptions, isRimrafOptions, RimrafAsyncOptions, RimrafOptions, RimrafSyncOptions, } from './opt-arg.js'; | ||
export { assertRimrafOptions, isRimrafOptions, type RimrafAsyncOptions, type RimrafOptions, type RimrafSyncOptions, } from './opt-arg.js'; | ||
export declare const nativeSync: (path: string | string[], opt?: RimrafSyncOptions) => boolean; | ||
@@ -4,0 +4,0 @@ export declare const native: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & { |
@@ -57,3 +57,5 @@ "use strict"; | ||
}); | ||
exports.rimrafSync = wrapSync((path, opt) => (0, use_native_js_1.useNativeSync)(opt) ? (0, rimraf_native_js_1.rimrafNativeSync)(path, opt) : (0, rimraf_manual_js_1.rimrafManualSync)(path, opt)); | ||
exports.rimrafSync = wrapSync((path, opt) => (0, use_native_js_1.useNativeSync)(opt) ? | ||
(0, rimraf_native_js_1.rimrafNativeSync)(path, opt) | ||
: (0, rimraf_manual_js_1.rimrafManualSync)(path, opt)); | ||
exports.sync = exports.rimrafSync; | ||
@@ -60,0 +62,0 @@ const rimraf_ = wrap((path, opt) => (0, use_native_js_1.useNative)(opt) ? (0, rimraf_native_js_1.rimrafNative)(path, opt) : (0, rimraf_manual_js_1.rimrafManual)(path, opt)); |
@@ -28,8 +28,8 @@ "use strict"; | ||
} | ||
const globOpt = glob === true | ||
? opt.signal | ||
? { signal: opt.signal } | ||
const globOpt = glob === true ? | ||
opt.signal ? | ||
{ signal: opt.signal } | ||
: {} | ||
: opt.signal | ||
? { | ||
: opt.signal ? | ||
{ | ||
signal: opt.signal, | ||
@@ -36,0 +36,0 @@ ...glob, |
@@ -1,1 +0,3 @@ | ||
{"type":"commonjs"} | ||
{ | ||
"type": "commonjs" | ||
} |
@@ -13,6 +13,4 @@ "use strict"; | ||
const ctor = path && type === 'object' && path.constructor; | ||
const received = ctor && ctor.name | ||
? `an instance of ${ctor.name}` | ||
: type === 'object' | ||
? (0, util_1.inspect)(path) | ||
const received = ctor && ctor.name ? `an instance of ${ctor.name}` | ||
: type === 'object' ? (0, util_1.inspect)(path) | ||
: `type ${type} ${path}`; | ||
@@ -19,0 +17,0 @@ const msg = 'The "path" argument must be of type string. ' + `Received ${received}`; |
@@ -16,8 +16,8 @@ "use strict"; | ||
// rm implementation is less advanced. Change this code if that changes. | ||
exports.useNative = !hasNative || platform_js_1.default === 'win32' | ||
? () => false | ||
exports.useNative = !hasNative || platform_js_1.default === 'win32' ? | ||
() => false | ||
: opt => !opt?.signal && !opt?.filter; | ||
exports.useNativeSync = !hasNative || platform_js_1.default === 'win32' | ||
? () => false | ||
exports.useNativeSync = !hasNative || platform_js_1.default === 'win32' ? | ||
() => false | ||
: opt => !opt?.signal && !opt?.filter; | ||
//# sourceMappingURL=use-native.js.map |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
import fs, { Dirent } from 'fs'; | ||
@@ -2,0 +3,0 @@ export { chmodSync, mkdirSync, renameSync, rmdirSync, rmSync, statSync, lstatSync, unlinkSync, } from 'fs'; |
@@ -14,3 +14,3 @@ // promisify ourselves, because older nodes don't have fs.promises | ||
const readdir = (path) => new Promise((res, rej) => fs.readdir(path, { withFileTypes: true }, (er, data) => er ? rej(er) : res(data))); | ||
const rename = (oldPath, newPath) => new Promise((res, rej) => fs.rename(oldPath, newPath, (er, ...d) => (er ? rej(er) : res(...d)))); | ||
const rename = (oldPath, newPath) => new Promise((res, rej) => fs.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d))); | ||
const rm = (path, options) => new Promise((res, rej) => fs.rm(path, options, (er, ...d) => (er ? rej(er) : res(...d)))); | ||
@@ -17,0 +17,0 @@ const rmdir = (path) => new Promise((res, rej) => fs.rmdir(path, (er, ...d) => (er ? rej(er) : res(...d)))); |
import { RimrafAsyncOptions, RimrafSyncOptions } from './opt-arg.js'; | ||
export { assertRimrafOptions, isRimrafOptions, RimrafAsyncOptions, RimrafOptions, RimrafSyncOptions, } from './opt-arg.js'; | ||
export { assertRimrafOptions, isRimrafOptions, type RimrafAsyncOptions, type RimrafOptions, type RimrafSyncOptions, } from './opt-arg.js'; | ||
export declare const nativeSync: (path: string | string[], opt?: RimrafSyncOptions) => boolean; | ||
@@ -4,0 +4,0 @@ export declare const native: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & { |
@@ -49,3 +49,5 @@ import { glob, globSync } from 'glob'; | ||
}); | ||
export const rimrafSync = wrapSync((path, opt) => useNativeSync(opt) ? rimrafNativeSync(path, opt) : rimrafManualSync(path, opt)); | ||
export const rimrafSync = wrapSync((path, opt) => useNativeSync(opt) ? | ||
rimrafNativeSync(path, opt) | ||
: rimrafManualSync(path, opt)); | ||
export const sync = rimrafSync; | ||
@@ -52,0 +54,0 @@ const rimraf_ = wrap((path, opt) => useNative(opt) ? rimrafNative(path, opt) : rimrafManual(path, opt)); |
@@ -23,8 +23,8 @@ const typeOrUndef = (val, t) => typeof val === 'undefined' || typeof val === t; | ||
} | ||
const globOpt = glob === true | ||
? opt.signal | ||
? { signal: opt.signal } | ||
const globOpt = glob === true ? | ||
opt.signal ? | ||
{ signal: opt.signal } | ||
: {} | ||
: opt.signal | ||
? { | ||
: opt.signal ? | ||
{ | ||
signal: opt.signal, | ||
@@ -31,0 +31,0 @@ ...glob, |
@@ -1,1 +0,3 @@ | ||
{"type":"module"} | ||
{ | ||
"type": "module" | ||
} |
@@ -8,6 +8,4 @@ import { parse, resolve } from 'path'; | ||
const ctor = path && type === 'object' && path.constructor; | ||
const received = ctor && ctor.name | ||
? `an instance of ${ctor.name}` | ||
: type === 'object' | ||
? inspect(path) | ||
const received = ctor && ctor.name ? `an instance of ${ctor.name}` | ||
: type === 'object' ? inspect(path) | ||
: `type ${type} ${path}`; | ||
@@ -14,0 +12,0 @@ const msg = 'The "path" argument must be of type string. ' + `Received ${received}`; |
@@ -10,8 +10,8 @@ import platform from './platform.js'; | ||
// rm implementation is less advanced. Change this code if that changes. | ||
export const useNative = !hasNative || platform === 'win32' | ||
? () => false | ||
export const useNative = !hasNative || platform === 'win32' ? | ||
() => false | ||
: opt => !opt?.signal && !opt?.filter; | ||
export const useNativeSync = !hasNative || platform === 'win32' | ||
? () => false | ||
export const useNativeSync = !hasNative || platform === 'win32' ? | ||
() => false | ||
: opt => !opt?.signal && !opt?.filter; | ||
//# sourceMappingURL=use-native.js.map |
{ | ||
"name": "rimraf", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"type": "module", | ||
@@ -44,3 +44,3 @@ "tshy": { | ||
"snap": "tap", | ||
"format": "prettier --write . --loglevel warn", | ||
"format": "prettier --write . --log-level warn", | ||
"benchmark": "node benchmark/index.js", | ||
@@ -50,2 +50,3 @@ "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" | ||
"prettier": { | ||
"experimentalTernaries": true, | ||
"semi": false, | ||
@@ -62,9 +63,9 @@ "printWidth": 80, | ||
"devDependencies": { | ||
"@types/node": "^20.6.5", | ||
"@types/node": "^20.12.11", | ||
"mkdirp": "^3.0.1", | ||
"prettier": "^2.8.2", | ||
"tap": "^18.1.4", | ||
"tshy": "^1.2.2", | ||
"typedoc": "^0.25.1", | ||
"typescript": "^5.2" | ||
"prettier": "^3.2.5", | ||
"tap": "^18.5.4", | ||
"tshy": "^1.14.0", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -71,0 +72,0 @@ "funding": { |
@@ -1,2 +0,3 @@ | ||
The [UNIX command](<http://en.wikipedia.org/wiki/Rm_(Unix)>) `rm -rf` for node. | ||
The [UNIX command](<http://en.wikipedia.org/wiki/Rm_(Unix)>) `rm -rf` for node | ||
in a cross-platform implementation. | ||
@@ -91,5 +92,5 @@ Install with `npm install rimraf`. | ||
The first argument to the filter is the path string. The | ||
The first argument to the filter is the path string. The | ||
second argument is either a `Dirent` or `Stats` object for that | ||
path. (The first path explored will be a `Stats`, the rest | ||
path. (The first path explored will be a `Stats`, the rest | ||
will be `Dirent`.) | ||
@@ -114,3 +115,3 @@ | ||
### `rimraf.sync(f, [opts])` `rimraf.rimrafSync(f, [opts])` | ||
### `rimraf.sync(f, [opts])` <br> `rimraf.rimrafSync(f, [opts])` | ||
@@ -128,3 +129,3 @@ Synchronous form of `rimraf()` | ||
### `rimraf.nativeSync(f, [opts])` `rimraf.native.sync(f, [opts])` | ||
### `rimraf.native.sync(f, [opts])` <br> `rimraf.nativeSync(f, [opts])` | ||
@@ -137,3 +138,3 @@ Synchronous form of `rimraf.native` | ||
### `rimraf.manualSync(f, [opts])` `rimraf.manualSync(f, opts)` | ||
### `rimraf.manual.sync(f, [opts])` <br> `rimraf.manualSync(f, opts)` | ||
@@ -154,3 +155,3 @@ Synchronous form of `rimraf.manual()` | ||
### `rimraf.windows.sync(path, [opts])` `rimraf.windowsSync(path, [opts])` | ||
### `rimraf.windows.sync(path, [opts])` <br> `rimraf.windowsSync(path, [opts])` | ||
@@ -178,3 +179,3 @@ Synchronous form of `rimraf.windows()` | ||
### `rimraf.moveRemove.sync(path, [opts])` `rimraf.moveRemoveSync(path, [opts])` | ||
### `rimraf.moveRemove.sync(path, [opts])` <br> `rimraf.moveRemoveSync(path, [opts])` | ||
@@ -181,0 +182,0 @@ Synchronous form of `rimraf.moveRemove()` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
281213
2433
221