-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make rimraf cancelable with AbortSignals
Fix: #257
- Loading branch information
Showing
11 changed files
with
152 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
const version = process.env.__TESTING_RIMRAF_NODE_VERSION__ || process.version | ||
const versArr = version.replace(/^v/, '').split('.') | ||
const hasNative = +versArr[0] > 14 || (+versArr[0] === 14 && +versArr[1] >= 14) | ||
import { RimrafOptions } from './index.js' | ||
// we do NOT use native by default on Windows, because Node's native | ||
// rm implementation is less advanced. Change this code if that changes. | ||
import platform from './platform.js' | ||
export const useNative = | ||
!hasNative || platform === 'win32' ? () => false : () => true | ||
export const useNativeSync = | ||
!hasNative || platform === 'win32' ? () => false : () => true | ||
export const useNative: (opt?: RimrafOptions) => boolean = | ||
!hasNative || platform === 'win32' ? () => false : opt => !opt?.signal | ||
export const useNativeSync: (opt?: RimrafOptions) => boolean = | ||
!hasNative || platform === 'win32' ? () => false : opt => !opt?.signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters