You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
448 B
11 lines
448 B
2 years ago
|
const fs = require('fs')
|
||
|
|
||
|
const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version
|
||
|
const versArr = version.replace(/^v/, '').split('.')
|
||
|
const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12
|
||
|
|
||
|
const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir
|
||
|
const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync
|
||
|
|
||
|
module.exports = {useNative, useNativeSync}
|