@stryke/fs 0.20.3 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/remove-file.cjs +8 -2
- package/dist/remove-file.d.ts +0 -2
- package/dist/remove-file.mjs +1 -1
- package/package.json +2 -2
package/dist/remove-file.cjs
CHANGED
|
@@ -7,11 +7,17 @@ exports.removeFileSync = exports.removeFile = void 0;
|
|
|
7
7
|
var _nodeFs = require("node:fs");
|
|
8
8
|
var _promises = require("node:fs/promises");
|
|
9
9
|
const removeFileSync = r => {
|
|
10
|
-
if (!r || !(0, _nodeFs.existsSync)(r))
|
|
10
|
+
if (!r || !(0, _nodeFs.existsSync)(r)) {
|
|
11
|
+
console.warn("Skipping - Invalid file path provided to `removeFileSync`");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
11
14
|
(0, _nodeFs.rmSync)(r);
|
|
12
15
|
},
|
|
13
16
|
removeFile = async r => {
|
|
14
|
-
if (!r || !(0, _nodeFs.existsSync)(r))
|
|
17
|
+
if (!r || !(0, _nodeFs.existsSync)(r)) {
|
|
18
|
+
console.warn("Skipping - Invalid file path provided to `removeFile`");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
15
21
|
return (0, _promises.rm)(r);
|
|
16
22
|
};
|
|
17
23
|
exports.removeFile = removeFile;
|
package/dist/remove-file.d.ts
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
* Remove the given content to the given file path
|
|
3
3
|
*
|
|
4
4
|
* @param filePath - The file path to remove to
|
|
5
|
-
* @param content - The content to remove to the file
|
|
6
5
|
*/
|
|
7
6
|
export declare const removeFileSync: (filePath: string) => void;
|
|
8
7
|
/**
|
|
9
8
|
* Remove the given content to the given file path
|
|
10
9
|
*
|
|
11
10
|
* @param filePath - The file path to read to
|
|
12
|
-
* @returns The content of the file
|
|
13
11
|
*/
|
|
14
12
|
export declare const removeFile: (filePath: string) => Promise<void>;
|
package/dist/remove-file.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as o,rmSync as e}from"node:fs";import{rm as i}from"node:fs/promises";export const removeFileSync=r=>{if(!r||!o(r))
|
|
1
|
+
import{existsSync as o,rmSync as e}from"node:fs";import{rm as i}from"node:fs/promises";export const removeFileSync=r=>{if(!r||!o(r)){console.warn("Skipping - Invalid file path provided to `removeFileSync`");return}e(r)},removeFile=async r=>{if(!r||!o(r)){console.warn("Skipping - Invalid file path provided to `removeFile`");return}return i(r)};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@antfu/install-pkg": "^1.0.0",
|
|
16
16
|
"@ltd/j-toml": "^1.38.0",
|
|
17
17
|
"@stryke/convert": "^0.2.0",
|
|
18
|
-
"@stryke/path": "^0.7.
|
|
18
|
+
"@stryke/path": "^0.7.5",
|
|
19
19
|
"@zkochan/js-yaml": "^0.0.7",
|
|
20
20
|
"chalk": "^5.4.1",
|
|
21
21
|
"defu": "^6.1.4",
|