@bemoje/path 1.1.1 → 1.1.3

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.
Files changed (64) hide show
  1. package/README.md +23 -22
  2. package/lib/index.d.cts +149 -16
  3. package/lib/index.d.ts +149 -16
  4. package/package.json +20 -220
  5. package/lib/lib/cwd.cjs +0 -16
  6. package/lib/lib/cwd.d.cts +0 -11
  7. package/lib/lib/cwd.d.ts +0 -11
  8. package/lib/lib/cwd.js +0 -10
  9. package/lib/lib/dirnameDeep.cjs +0 -17
  10. package/lib/lib/dirnameDeep.d.cts +0 -9
  11. package/lib/lib/dirnameDeep.d.ts +0 -9
  12. package/lib/lib/dirnameDeep.js +0 -11
  13. package/lib/lib/hasBasename.cjs +0 -18
  14. package/lib/lib/hasBasename.d.cts +0 -8
  15. package/lib/lib/hasBasename.d.ts +0 -8
  16. package/lib/lib/hasBasename.js +0 -12
  17. package/lib/lib/hasExtname.cjs +0 -60
  18. package/lib/lib/hasExtname.d.cts +0 -15
  19. package/lib/lib/hasExtname.d.ts +0 -15
  20. package/lib/lib/hasExtname.js +0 -58
  21. package/lib/lib/hasParentDirname.cjs +0 -12
  22. package/lib/lib/hasParentDirname.d.cts +0 -6
  23. package/lib/lib/hasParentDirname.d.ts +0 -6
  24. package/lib/lib/hasParentDirname.js +0 -10
  25. package/lib/lib/isDotFile.cjs +0 -12
  26. package/lib/lib/isDotFile.d.cts +0 -8
  27. package/lib/lib/isDotFile.d.ts +0 -8
  28. package/lib/lib/isDotFile.js +0 -10
  29. package/lib/lib/isExtValid.cjs +0 -12
  30. package/lib/lib/isExtValid.d.cts +0 -13
  31. package/lib/lib/isExtValid.d.ts +0 -13
  32. package/lib/lib/isExtValid.js +0 -10
  33. package/lib/lib/isRelative.cjs +0 -16
  34. package/lib/lib/isRelative.d.cts +0 -6
  35. package/lib/lib/isRelative.d.ts +0 -6
  36. package/lib/lib/isRelative.js +0 -10
  37. package/lib/lib/isUnc.cjs +0 -12
  38. package/lib/lib/isUnc.d.cts +0 -8
  39. package/lib/lib/isUnc.d.ts +0 -8
  40. package/lib/lib/isUnc.js +0 -10
  41. package/lib/lib/isValidWin32.cjs +0 -29
  42. package/lib/lib/isValidWin32.d.cts +0 -11
  43. package/lib/lib/isValidWin32.d.ts +0 -11
  44. package/lib/lib/isValidWin32.js +0 -27
  45. package/lib/lib/prefixFilename.cjs +0 -18
  46. package/lib/lib/prefixFilename.d.cts +0 -11
  47. package/lib/lib/prefixFilename.d.ts +0 -11
  48. package/lib/lib/prefixFilename.js +0 -12
  49. package/lib/lib/root.cjs +0 -16
  50. package/lib/lib/root.d.cts +0 -6
  51. package/lib/lib/root.d.ts +0 -6
  52. package/lib/lib/root.js +0 -10
  53. package/lib/lib/suffixFilename.cjs +0 -18
  54. package/lib/lib/suffixFilename.d.cts +0 -11
  55. package/lib/lib/suffixFilename.d.ts +0 -11
  56. package/lib/lib/suffixFilename.js +0 -12
  57. package/lib/lib/toCwdRelative.cjs +0 -16
  58. package/lib/lib/toCwdRelative.d.cts +0 -8
  59. package/lib/lib/toCwdRelative.d.ts +0 -8
  60. package/lib/lib/toCwdRelative.js +0 -10
  61. package/lib/lib/toWin32.cjs +0 -12
  62. package/lib/lib/toWin32.d.cts +0 -6
  63. package/lib/lib/toWin32.d.ts +0 -6
  64. package/lib/lib/toWin32.js +0 -10
package/lib/lib/cwd.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Join paths starting from process.cwd()
3
- *
4
- * @example ```ts
5
- * // equivalent to:
6
- * path.join(process.cwd(), ...p)
7
- * ```
8
- */
9
- declare function cwd(...p: string[]): string;
10
-
11
- export { cwd };
package/lib/lib/cwd.js DELETED
@@ -1,10 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function cwd(...p) {
6
- return upath.joinSafe(process.cwd(), ...p);
7
- }
8
- __name(cwd, "cwd");
9
-
10
- export { cwd };
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function dirnameDeep(p, depth) {
12
- const parent = upath__default.default.dirname(p);
13
- return depth && depth > 1 ? dirnameDeep(parent, depth - 1) : parent;
14
- }
15
- __name(dirnameDeep, "dirnameDeep");
16
-
17
- exports.dirnameDeep = dirnameDeep;
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns the absolute path of the parent directory of the given path.
3
- * @param p the path
4
- * @param depth how many times to get the parent directory
5
- * @example dirnameDeep('a/b/c/d', 2) => 'a/b'
6
- */
7
- declare function dirnameDeep(p: string, depth?: number): string;
8
-
9
- export { dirnameDeep };
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns the absolute path of the parent directory of the given path.
3
- * @param p the path
4
- * @param depth how many times to get the parent directory
5
- * @example dirnameDeep('a/b/c/d', 2) => 'a/b'
6
- */
7
- declare function dirnameDeep(p: string, depth?: number): string;
8
-
9
- export { dirnameDeep };
@@ -1,11 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function dirnameDeep(p, depth) {
6
- const parent = upath.dirname(p);
7
- return depth && depth > 1 ? dirnameDeep(parent, depth - 1) : parent;
8
- }
9
- __name(dirnameDeep, "dirnameDeep");
10
-
11
- export { dirnameDeep };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function hasBasename(tsFilepath, basenames) {
12
- return [
13
- basenames
14
- ].flat(2).includes(upath__default.default.basename(tsFilepath));
15
- }
16
- __name(hasBasename, "hasBasename");
17
-
18
- exports.hasBasename = hasBasename;
@@ -1,8 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.cjs';
2
-
3
- /**
4
- * Checks if a file path has any of the specified basenames.
5
- */
6
- declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
7
-
8
- export { hasBasename };
@@ -1,8 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.js';
2
-
3
- /**
4
- * Checks if a file path has any of the specified basenames.
5
- */
6
- declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
7
-
8
- export { hasBasename };
@@ -1,12 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function hasBasename(tsFilepath, basenames) {
6
- return [
7
- basenames
8
- ].flat(2).includes(upath.basename(tsFilepath));
9
- }
10
- __name(hasBasename, "hasBasename");
11
-
12
- export { hasBasename };
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // ../fn/src/setNameAndLength.ts
7
- function setNameAndLength(source, target, lengthDelta = 0) {
8
- return Object.defineProperties(target, {
9
- name: {
10
- configurable: true,
11
- value: source.name
12
- },
13
- length: {
14
- configurable: true,
15
- value: source.length + lengthDelta
16
- }
17
- });
18
- }
19
- __name(setNameAndLength, "setNameAndLength");
20
-
21
- // ../fn/src/bindArg.ts
22
- function bindArg(fn, boundArgIndex, boundArgValue) {
23
- return setNameAndLength(fn, (...args) => {
24
- return fn(...args.slice(0, boundArgIndex), boundArgValue, ...args.slice(boundArgIndex));
25
- }, -1);
26
- }
27
- __name(bindArg, "bindArg");
28
-
29
- // src/lib/hasExtname.ts
30
- function hasExtname(tsFilepath, extnames) {
31
- return new RegExp(`[.](${[
32
- extnames
33
- ].flat(2).join("|")})$`).test(tsFilepath);
34
- }
35
- __name(hasExtname, "hasExtname");
36
- hasExtname.js = bindArg(hasExtname, 1, [
37
- "js",
38
- "mjs",
39
- "jsx",
40
- "cjs"
41
- ]);
42
- hasExtname.json = bindArg(hasExtname, 1, [
43
- "json",
44
- "jsonc"
45
- ]);
46
- hasExtname.yaml = bindArg(hasExtname, 1, [
47
- "yaml",
48
- "yml"
49
- ]);
50
- hasExtname.markdown = bindArg(hasExtname, 1, [
51
- "md",
52
- "markdown"
53
- ]);
54
- hasExtname.ts = bindArg(hasExtname, 1, [
55
- "ts",
56
- "mts",
57
- "tsx"
58
- ]);
59
-
60
- exports.hasExtname = hasExtname;
@@ -1,15 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.cjs';
2
-
3
- /**
4
- * Checks if a file path has any of the specified file extensions.
5
- */
6
- declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
7
- declare namespace hasExtname {
8
- var js: (tsFilepath: string) => boolean;
9
- var json: (tsFilepath: string) => boolean;
10
- var yaml: (tsFilepath: string) => boolean;
11
- var markdown: (tsFilepath: string) => boolean;
12
- var ts: (tsFilepath: string) => boolean;
13
- }
14
-
15
- export { hasExtname };
@@ -1,15 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.js';
2
-
3
- /**
4
- * Checks if a file path has any of the specified file extensions.
5
- */
6
- declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
7
- declare namespace hasExtname {
8
- var js: (tsFilepath: string) => boolean;
9
- var json: (tsFilepath: string) => boolean;
10
- var yaml: (tsFilepath: string) => boolean;
11
- var markdown: (tsFilepath: string) => boolean;
12
- var ts: (tsFilepath: string) => boolean;
13
- }
14
-
15
- export { hasExtname };
@@ -1,58 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // ../fn/src/setNameAndLength.ts
5
- function setNameAndLength(source, target, lengthDelta = 0) {
6
- return Object.defineProperties(target, {
7
- name: {
8
- configurable: true,
9
- value: source.name
10
- },
11
- length: {
12
- configurable: true,
13
- value: source.length + lengthDelta
14
- }
15
- });
16
- }
17
- __name(setNameAndLength, "setNameAndLength");
18
-
19
- // ../fn/src/bindArg.ts
20
- function bindArg(fn, boundArgIndex, boundArgValue) {
21
- return setNameAndLength(fn, (...args) => {
22
- return fn(...args.slice(0, boundArgIndex), boundArgValue, ...args.slice(boundArgIndex));
23
- }, -1);
24
- }
25
- __name(bindArg, "bindArg");
26
-
27
- // src/lib/hasExtname.ts
28
- function hasExtname(tsFilepath, extnames) {
29
- return new RegExp(`[.](${[
30
- extnames
31
- ].flat(2).join("|")})$`).test(tsFilepath);
32
- }
33
- __name(hasExtname, "hasExtname");
34
- hasExtname.js = bindArg(hasExtname, 1, [
35
- "js",
36
- "mjs",
37
- "jsx",
38
- "cjs"
39
- ]);
40
- hasExtname.json = bindArg(hasExtname, 1, [
41
- "json",
42
- "jsonc"
43
- ]);
44
- hasExtname.yaml = bindArg(hasExtname, 1, [
45
- "yaml",
46
- "yml"
47
- ]);
48
- hasExtname.markdown = bindArg(hasExtname, 1, [
49
- "md",
50
- "markdown"
51
- ]);
52
- hasExtname.ts = bindArg(hasExtname, 1, [
53
- "ts",
54
- "mts",
55
- "tsx"
56
- ]);
57
-
58
- export { hasExtname };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/lib/hasParentDirname.ts
7
- function hasParentDirname(fspath, name) {
8
- return new RegExp(`(^|[/\\\\])${name}[/\\\\]`).test(fspath);
9
- }
10
- __name(hasParentDirname, "hasParentDirname");
11
-
12
- exports.hasParentDirname = hasParentDirname;
@@ -1,6 +0,0 @@
1
- /**
2
- * Whether fspath is a subpath of a parent directory with the given name.
3
- */
4
- declare function hasParentDirname(fspath: string, name: string): boolean;
5
-
6
- export { hasParentDirname };
@@ -1,6 +0,0 @@
1
- /**
2
- * Whether fspath is a subpath of a parent directory with the given name.
3
- */
4
- declare function hasParentDirname(fspath: string, name: string): boolean;
5
-
6
- export { hasParentDirname };
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/lib/hasParentDirname.ts
5
- function hasParentDirname(fspath, name) {
6
- return new RegExp(`(^|[/\\\\])${name}[/\\\\]`).test(fspath);
7
- }
8
- __name(hasParentDirname, "hasParentDirname");
9
-
10
- export { hasParentDirname };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/lib/isDotFile.ts
7
- function isDotFile(filepath) {
8
- return /(?:^|[/\\])(\.(?!\.)[^/\\]+)$/.test(filepath);
9
- }
10
- __name(isDotFile, "isDotFile");
11
-
12
- exports.isDotFile = isDotFile;
@@ -1,8 +0,0 @@
1
- /**
2
- * Determines if a given filepath is a dotfile.
3
- * @param filepath - The filepath to evaluate.
4
- * @returns A boolean indicating whether the filepath is a dotfile.
5
- */
6
- declare function isDotFile(filepath: string): boolean;
7
-
8
- export { isDotFile };
@@ -1,8 +0,0 @@
1
- /**
2
- * Determines if a given filepath is a dotfile.
3
- * @param filepath - The filepath to evaluate.
4
- * @returns A boolean indicating whether the filepath is a dotfile.
5
- */
6
- declare function isDotFile(filepath: string): boolean;
7
-
8
- export { isDotFile };
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/lib/isDotFile.ts
5
- function isDotFile(filepath) {
6
- return /(?:^|[/\\])(\.(?!\.)[^/\\]+)$/.test(filepath);
7
- }
8
- __name(isDotFile, "isDotFile");
9
-
10
- export { isDotFile };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/lib/isExtValid.ts
7
- function isExtValid(ext) {
8
- return !!ext && ext !== "." && !/["*:<>?|]/.test(ext);
9
- }
10
- __name(isExtValid, "isExtValid");
11
-
12
- exports.isExtValid = isExtValid;
@@ -1,13 +0,0 @@
1
- /**
2
- * Check if a file extension is valid.
3
- *
4
- * Invalid:
5
- * - empty string
6
- * - single dot: "."
7
- * - illegal characters: <>"|?*:
8
- *
9
- * @param ext - The file extension to check.
10
- */
11
- declare function isExtValid(ext: string): boolean;
12
-
13
- export { isExtValid };
@@ -1,13 +0,0 @@
1
- /**
2
- * Check if a file extension is valid.
3
- *
4
- * Invalid:
5
- * - empty string
6
- * - single dot: "."
7
- * - illegal characters: <>"|?*:
8
- *
9
- * @param ext - The file extension to check.
10
- */
11
- declare function isExtValid(ext: string): boolean;
12
-
13
- export { isExtValid };
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/lib/isExtValid.ts
5
- function isExtValid(ext) {
6
- return !!ext && ext !== "." && !/["*:<>?|]/.test(ext);
7
- }
8
- __name(isExtValid, "isExtValid");
9
-
10
- export { isExtValid };
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var path = require('path');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var path__default = /*#__PURE__*/_interopDefault(path);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function isRelative(p) {
12
- return !path__default.default.isAbsolute(p);
13
- }
14
- __name(isRelative, "isRelative");
15
-
16
- exports.isRelative = isRelative;
@@ -1,6 +0,0 @@
1
- /**
2
- * Whether a path is a relative string, ie. not absolute.
3
- */
4
- declare function isRelative(p: string): boolean;
5
-
6
- export { isRelative };
@@ -1,6 +0,0 @@
1
- /**
2
- * Whether a path is a relative string, ie. not absolute.
3
- */
4
- declare function isRelative(p: string): boolean;
5
-
6
- export { isRelative };
@@ -1,10 +0,0 @@
1
- import path from 'path';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function isRelative(p) {
6
- return !path.isAbsolute(p);
7
- }
8
- __name(isRelative, "isRelative");
9
-
10
- export { isRelative };
package/lib/lib/isUnc.cjs DELETED
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/lib/isUnc.ts
7
- function isUnc(filepath) {
8
- return /^[/\\]{2,}[^/\\]+[/\\]+[^/\\]+/.test(filepath);
9
- }
10
- __name(isUnc, "isUnc");
11
-
12
- exports.isUnc = isUnc;
@@ -1,8 +0,0 @@
1
- /**
2
- * Determines if a given filepath is a UNC path.
3
- * @param filepath - The filepath to evaluate.
4
- * @returns A boolean indicating whether the filepath is a UNC path.
5
- */
6
- declare function isUnc(filepath: string): boolean;
7
-
8
- export { isUnc };
@@ -1,8 +0,0 @@
1
- /**
2
- * Determines if a given filepath is a UNC path.
3
- * @param filepath - The filepath to evaluate.
4
- * @returns A boolean indicating whether the filepath is a UNC path.
5
- */
6
- declare function isUnc(filepath: string): boolean;
7
-
8
- export { isUnc };
package/lib/lib/isUnc.js DELETED
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/lib/isUnc.ts
5
- function isUnc(filepath) {
6
- return /^[/\\]{2,}[^/\\]+[/\\]+[^/\\]+/.test(filepath);
7
- }
8
- __name(isUnc, "isUnc");
9
-
10
- export { isUnc };
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/lib/isValidWin32.ts
7
- function isValidWin32(path, options) {
8
- if (path.length === 0) {
9
- return false;
10
- }
11
- if (path.includes("/") && path.includes("\\")) {
12
- return false;
13
- }
14
- const maxLength = (options && options.extendedMaxLength ? 32767 : 260) - 12;
15
- if (path.length > maxLength) {
16
- return false;
17
- }
18
- const noDriveLetter = /^\w:(\\|\/)/g.test(path) ? path.substring(2) : path;
19
- if (/["*:<>?|]/g.test(noDriveLetter)) {
20
- return false;
21
- }
22
- if (/(\\|\/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])((\\|\/)|$)/g.test(path)) {
23
- return false;
24
- }
25
- return true;
26
- }
27
- __name(isValidWin32, "isValidWin32");
28
-
29
- exports.isValidWin32 = isValidWin32;
@@ -1,11 +0,0 @@
1
- /**
2
- * Check whether a provided windows filesystem path string is valid according to:
3
- * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
4
- * @param path The path to validate.
5
- * @throws If the path is invalid and the `assert` option is true.
6
- */
7
- declare function isValidWin32(path: string, options?: {
8
- extendedMaxLength?: boolean;
9
- }): boolean;
10
-
11
- export { isValidWin32 };
@@ -1,11 +0,0 @@
1
- /**
2
- * Check whether a provided windows filesystem path string is valid according to:
3
- * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
4
- * @param path The path to validate.
5
- * @throws If the path is invalid and the `assert` option is true.
6
- */
7
- declare function isValidWin32(path: string, options?: {
8
- extendedMaxLength?: boolean;
9
- }): boolean;
10
-
11
- export { isValidWin32 };
@@ -1,27 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/lib/isValidWin32.ts
5
- function isValidWin32(path, options) {
6
- if (path.length === 0) {
7
- return false;
8
- }
9
- if (path.includes("/") && path.includes("\\")) {
10
- return false;
11
- }
12
- const maxLength = (options && options.extendedMaxLength ? 32767 : 260) - 12;
13
- if (path.length > maxLength) {
14
- return false;
15
- }
16
- const noDriveLetter = /^\w:(\\|\/)/g.test(path) ? path.substring(2) : path;
17
- if (/["*:<>?|]/g.test(noDriveLetter)) {
18
- return false;
19
- }
20
- if (/(\\|\/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])((\\|\/)|$)/g.test(path)) {
21
- return false;
22
- }
23
- return true;
24
- }
25
- __name(isValidWin32, "isValidWin32");
26
-
27
- export { isValidWin32 };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function prefixFilename(filePath, prefix) {
12
- const ext = upath__default.default.extname(filePath);
13
- const fileNameWithoutExt = upath__default.default.basename(filePath, ext);
14
- return upath__default.default.joinSafe(upath__default.default.dirname(filePath), prefix + fileNameWithoutExt + ext);
15
- }
16
- __name(prefixFilename, "prefixFilename");
17
-
18
- exports.prefixFilename = prefixFilename;
@@ -1,11 +0,0 @@
1
- /**
2
- * Append string to the beginning of the filename.
3
- *
4
- * @example ```ts
5
- * path.fileNameWithPrefix('path/to/file-name.ext', 'new-')
6
- * // => path/to/new-file-name.ext
7
- * ```
8
- */
9
- declare function prefixFilename(filePath: string, prefix: string): string;
10
-
11
- export { prefixFilename };
@@ -1,11 +0,0 @@
1
- /**
2
- * Append string to the beginning of the filename.
3
- *
4
- * @example ```ts
5
- * path.fileNameWithPrefix('path/to/file-name.ext', 'new-')
6
- * // => path/to/new-file-name.ext
7
- * ```
8
- */
9
- declare function prefixFilename(filePath: string, prefix: string): string;
10
-
11
- export { prefixFilename };
@@ -1,12 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function prefixFilename(filePath, prefix) {
6
- const ext = upath.extname(filePath);
7
- const fileNameWithoutExt = upath.basename(filePath, ext);
8
- return upath.joinSafe(upath.dirname(filePath), prefix + fileNameWithoutExt + ext);
9
- }
10
- __name(prefixFilename, "prefixFilename");
11
-
12
- export { prefixFilename };