@stryke/fs 0.20.4 → 0.20.6

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.
@@ -7,12 +7,10 @@ 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)) throw new Error("Invalid file path provided to remove data");
11
- (0, _nodeFs.rmSync)(r);
10
+ !r || !(0, _nodeFs.existsSync)(r) || (0, _nodeFs.rmSync)(r);
12
11
  },
13
12
  removeFile = async r => {
14
- if (!r || !(0, _nodeFs.existsSync)(r)) throw new Error("Invalid file path provided to remove data");
15
- return (0, _promises.rm)(r);
13
+ if (!(!r || !(0, _nodeFs.existsSync)(r))) return (0, _promises.rm)(r);
16
14
  };
17
15
  exports.removeFile = removeFile;
18
16
  exports.removeFileSync = removeFileSync;
@@ -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>;
@@ -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))throw new Error("Invalid file path provided to remove data");e(r)},removeFile=async r=>{if(!r||!o(r))throw new Error("Invalid file path provided to remove data");return i(r)};
1
+ import{existsSync as o,rmSync as n}from"node:fs";import{rm as e}from"node:fs/promises";export const removeFileSync=r=>{!r||!o(r)||n(r)},removeFile=async r=>{if(!(!r||!o(r)))return e(r)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/fs",
3
- "version": "0.20.4",
3
+ "version": "0.20.6",
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": {
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@antfu/install-pkg": "^1.0.0",
16
16
  "@ltd/j-toml": "^1.38.0",
17
- "@stryke/convert": "^0.2.0",
17
+ "@stryke/convert": "^0.2.1",
18
18
  "@stryke/path": "^0.7.5",
19
19
  "@zkochan/js-yaml": "^0.0.7",
20
20
  "chalk": "^5.4.1",