webext-schema
Advanced tools
Comparing version 2.3.4 to 3.0.0
@@ -6,3 +6,2 @@ /** | ||
/* api */ | ||
import { IS_WIN } from './constant.js'; | ||
import { fileURLToPath } from 'url'; | ||
@@ -12,2 +11,3 @@ import { getType, isString } from './common.js'; | ||
import path from 'path'; | ||
import { IS_WIN } from './constant.js'; | ||
@@ -140,3 +140,3 @@ /* constants */ | ||
/** | ||
* remove the directory and it's files | ||
* remove the directory and it's files synchronously | ||
* | ||
@@ -152,12 +152,6 @@ * @param {string} dir - directory path | ||
} | ||
const files = fs.readdirSync(dir); | ||
files.length && files.forEach(file => { | ||
const cur = path.join(dir, file); | ||
if (fs.lstatSync(cur).isDirectory()) { | ||
removeDir(cur, baseDir); | ||
} else { | ||
fs.unlinkSync(cur); | ||
} | ||
fs.rmSync(dir, { | ||
force: true, | ||
recursive: true | ||
}); | ||
fs.rmdirSync(dir); | ||
} | ||
@@ -174,3 +168,11 @@ }; | ||
export const removeDirectory = async (dir, baseDir) => { | ||
await removeDir(dir, baseDir); | ||
if (isDir(dir)) { | ||
if (!isSubDir(dir, baseDir)) { | ||
throw new Error(`${dir} is not a subdirectory of ${baseDir}.`); | ||
} | ||
await fsPromise.rm(dir, { | ||
force: true, | ||
recursive: true | ||
}); | ||
} | ||
}; | ||
@@ -177,0 +179,0 @@ |
@@ -36,3 +36,3 @@ { | ||
"node-fetch": "^3.2.4", | ||
"sinon": "^13.0.2" | ||
"sinon": "^14.0.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "devDependencies": { | ||
"chai": "^4.3.6", | ||
"eslint": "^8.14.0", | ||
"eslint": "^8.15.0", | ||
"eslint-config-standard": "^17.0.0", | ||
@@ -53,3 +53,3 @@ "eslint-plugin-import": "^2.26.0", | ||
}, | ||
"version": "2.3.4" | ||
"version": "3.0.0" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
3385737
95546
+ Added@sinonjs/commons@2.0.0(transitive)
+ Added@sinonjs/samsam@7.0.1(transitive)
+ Addedsinon@14.0.2(transitive)
- Removed@sinonjs/samsam@6.1.3(transitive)
- Removedsinon@13.0.2(transitive)
Updatedsinon@^14.0.0