@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.
- package/README.md +23 -22
- package/lib/index.d.cts +149 -16
- package/lib/index.d.ts +149 -16
- package/package.json +20 -220
- package/lib/lib/cwd.cjs +0 -16
- package/lib/lib/cwd.d.cts +0 -11
- package/lib/lib/cwd.d.ts +0 -11
- package/lib/lib/cwd.js +0 -10
- package/lib/lib/dirnameDeep.cjs +0 -17
- package/lib/lib/dirnameDeep.d.cts +0 -9
- package/lib/lib/dirnameDeep.d.ts +0 -9
- package/lib/lib/dirnameDeep.js +0 -11
- package/lib/lib/hasBasename.cjs +0 -18
- package/lib/lib/hasBasename.d.cts +0 -8
- package/lib/lib/hasBasename.d.ts +0 -8
- package/lib/lib/hasBasename.js +0 -12
- package/lib/lib/hasExtname.cjs +0 -60
- package/lib/lib/hasExtname.d.cts +0 -15
- package/lib/lib/hasExtname.d.ts +0 -15
- package/lib/lib/hasExtname.js +0 -58
- package/lib/lib/hasParentDirname.cjs +0 -12
- package/lib/lib/hasParentDirname.d.cts +0 -6
- package/lib/lib/hasParentDirname.d.ts +0 -6
- package/lib/lib/hasParentDirname.js +0 -10
- package/lib/lib/isDotFile.cjs +0 -12
- package/lib/lib/isDotFile.d.cts +0 -8
- package/lib/lib/isDotFile.d.ts +0 -8
- package/lib/lib/isDotFile.js +0 -10
- package/lib/lib/isExtValid.cjs +0 -12
- package/lib/lib/isExtValid.d.cts +0 -13
- package/lib/lib/isExtValid.d.ts +0 -13
- package/lib/lib/isExtValid.js +0 -10
- package/lib/lib/isRelative.cjs +0 -16
- package/lib/lib/isRelative.d.cts +0 -6
- package/lib/lib/isRelative.d.ts +0 -6
- package/lib/lib/isRelative.js +0 -10
- package/lib/lib/isUnc.cjs +0 -12
- package/lib/lib/isUnc.d.cts +0 -8
- package/lib/lib/isUnc.d.ts +0 -8
- package/lib/lib/isUnc.js +0 -10
- package/lib/lib/isValidWin32.cjs +0 -29
- package/lib/lib/isValidWin32.d.cts +0 -11
- package/lib/lib/isValidWin32.d.ts +0 -11
- package/lib/lib/isValidWin32.js +0 -27
- package/lib/lib/prefixFilename.cjs +0 -18
- package/lib/lib/prefixFilename.d.cts +0 -11
- package/lib/lib/prefixFilename.d.ts +0 -11
- package/lib/lib/prefixFilename.js +0 -12
- package/lib/lib/root.cjs +0 -16
- package/lib/lib/root.d.cts +0 -6
- package/lib/lib/root.d.ts +0 -6
- package/lib/lib/root.js +0 -10
- package/lib/lib/suffixFilename.cjs +0 -18
- package/lib/lib/suffixFilename.d.cts +0 -11
- package/lib/lib/suffixFilename.d.ts +0 -11
- package/lib/lib/suffixFilename.js +0 -12
- package/lib/lib/toCwdRelative.cjs +0 -16
- package/lib/lib/toCwdRelative.d.cts +0 -8
- package/lib/lib/toCwdRelative.d.ts +0 -8
- package/lib/lib/toCwdRelative.js +0 -10
- package/lib/lib/toWin32.cjs +0 -12
- package/lib/lib/toWin32.d.cts +0 -6
- package/lib/lib/toWin32.d.ts +0 -6
- package/lib/lib/toWin32.js +0 -10
package/README.md
CHANGED
|
@@ -2,8 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Cross-platform path utilities extending upath with validation, manipulation, and inspection helpers.
|
|
4
4
|
|
|
5
|
-
[](https://www.typescriptlang.org/)
|
|
6
|
-
|
|
5
|
+
[](https://www.typescriptlang.org/) [](https://nodejs.org/api/esm.html)
|
|
6
|
+
|
|
7
|
+
## Exports
|
|
8
|
+
|
|
9
|
+
<!-- EXPORTS_START -->
|
|
10
|
+
|
|
11
|
+
- **cwd**
|
|
12
|
+
- **dirnameDeep**: Returns the absolute path of the parent directory of the given path.
|
|
13
|
+
- **hasBasename**: Checks if a file path has any of the specified basenames.
|
|
14
|
+
- **hasExtname**: Checks if a file path has any of the specified file extensions.
|
|
15
|
+
- **hasParentDirname**: Whether fspath is a subpath of a parent directory with the given name.
|
|
16
|
+
- **isDotFile**: Determines if a given filepath is a dotfile.
|
|
17
|
+
- **isExtValid**: Check if a file extension is valid. Invalid: - empty string - single dot: "." - illegal characters: <>"|?\*:
|
|
18
|
+
- **isRelative**: Whether a path is a relative string, ie. not absolute.
|
|
19
|
+
- **isUnc**: Determines if a given filepath is a UNC path.
|
|
20
|
+
- **isValidWin32**.aspx
|
|
21
|
+
- **prefixFilename**: Append string to the beginning of the filename.
|
|
22
|
+
- **root**: Returns the root directory of a given path.
|
|
23
|
+
- **suffixFilename**: Append string to the end of the filename.
|
|
24
|
+
- **toCwdRelative** path to the {p} path. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
|
|
25
|
+
- **toWin32**: Ensures win32 backslashes are used instead of forward slashes.
|
|
26
|
+
|
|
27
|
+
<!-- EXPORTS_END -->
|
|
7
28
|
|
|
8
29
|
## Installation
|
|
9
30
|
|
|
@@ -73,23 +94,3 @@ dirnameDeep('a/b/c/d', 2) // 'a/b'
|
|
|
73
94
|
root('/home/user') // '/'
|
|
74
95
|
toWin32('path/to/file') // 'path\\to\\file'
|
|
75
96
|
```
|
|
76
|
-
|
|
77
|
-
## API Reference
|
|
78
|
-
|
|
79
|
-
| Export | Description |
|
|
80
|
-
| ------------------ | ---------------------------------------------- |
|
|
81
|
-
| `cwd` | Join paths from process.cwd() |
|
|
82
|
-
| `toCwdRelative` | Convert absolute path to cwd-relative |
|
|
83
|
-
| `prefixFilename` | Prepend string to filename |
|
|
84
|
-
| `suffixFilename` | Append string to filename (before extension) |
|
|
85
|
-
| `dirnameDeep` | Get parent directory N levels up |
|
|
86
|
-
| `hasBasename` | Check if path has a specific basename |
|
|
87
|
-
| `hasExtname` | Check if path has specific extension(s) |
|
|
88
|
-
| `hasParentDirname` | Check if path is under a parent directory name |
|
|
89
|
-
| `isDotFile` | Check if path is a dotfile |
|
|
90
|
-
| `isExtValid` | Validate a file extension |
|
|
91
|
-
| `isRelative` | Check if path is relative |
|
|
92
|
-
| `isUnc` | Check if path is a UNC path |
|
|
93
|
-
| `isValidWin32` | Validate a Windows file path |
|
|
94
|
-
| `root` | Get root directory of a path |
|
|
95
|
-
| `toWin32` | Convert forward slashes to backslashes |
|
package/lib/index.d.cts
CHANGED
|
@@ -1,16 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
/**
|
|
12
|
+
* Returns the absolute path of the parent directory of the given path.
|
|
13
|
+
* @param p the path
|
|
14
|
+
* @param depth how many times to get the parent directory
|
|
15
|
+
* @example dirnameDeep('a/b/c/d', 2) => 'a/b'
|
|
16
|
+
*/
|
|
17
|
+
declare function dirnameDeep(p: string, depth?: number): string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
Create a type that represents either the value or an array of the value.
|
|
21
|
+
|
|
22
|
+
@see {@link Promisable}
|
|
23
|
+
|
|
24
|
+
@example
|
|
25
|
+
```
|
|
26
|
+
import type {Arrayable} from 'type-fest';
|
|
27
|
+
|
|
28
|
+
function bundle(input: string, output: Arrayable<string>) {
|
|
29
|
+
const outputList = Array.isArray(output) ? output : [output];
|
|
30
|
+
|
|
31
|
+
// …
|
|
32
|
+
|
|
33
|
+
for (const output of outputList) {
|
|
34
|
+
console.log(`write ${input} to: ${output}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bundle('src/index.js', 'dist/index.js');
|
|
39
|
+
bundle('src/index.js', ['dist/index.cjs', 'dist/index.mjs']);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
@category Array
|
|
43
|
+
*/
|
|
44
|
+
type Arrayable<T> =
|
|
45
|
+
T
|
|
46
|
+
// TODO: Use `readonly T[]` when this issue is resolved: https://github.com/microsoft/TypeScript/issues/17002
|
|
47
|
+
| T[];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checks if a file path has any of the specified basenames.
|
|
51
|
+
*/
|
|
52
|
+
declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Checks if a file path has any of the specified file extensions.
|
|
56
|
+
*/
|
|
57
|
+
declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
|
|
58
|
+
declare namespace hasExtname {
|
|
59
|
+
var js: (tsFilepath: string) => boolean;
|
|
60
|
+
var json: (tsFilepath: string) => boolean;
|
|
61
|
+
var yaml: (tsFilepath: string) => boolean;
|
|
62
|
+
var markdown: (tsFilepath: string) => boolean;
|
|
63
|
+
var ts: (tsFilepath: string) => boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether fspath is a subpath of a parent directory with the given name.
|
|
68
|
+
*/
|
|
69
|
+
declare function hasParentDirname(fspath: string, name: string): boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Determines if a given filepath is a dotfile.
|
|
73
|
+
* @param filepath - The filepath to evaluate.
|
|
74
|
+
* @returns A boolean indicating whether the filepath is a dotfile.
|
|
75
|
+
*/
|
|
76
|
+
declare function isDotFile(filepath: string): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if a file extension is valid.
|
|
80
|
+
*
|
|
81
|
+
* Invalid:
|
|
82
|
+
* - empty string
|
|
83
|
+
* - single dot: "."
|
|
84
|
+
* - illegal characters: <>"|?*:
|
|
85
|
+
*
|
|
86
|
+
* @param ext - The file extension to check.
|
|
87
|
+
*/
|
|
88
|
+
declare function isExtValid(ext: string): boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Whether a path is a relative string, ie. not absolute.
|
|
92
|
+
*/
|
|
93
|
+
declare function isRelative(p: string): boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Determines if a given filepath is a UNC path.
|
|
97
|
+
* @param filepath - The filepath to evaluate.
|
|
98
|
+
* @returns A boolean indicating whether the filepath is a UNC path.
|
|
99
|
+
*/
|
|
100
|
+
declare function isUnc(filepath: string): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check whether a provided windows filesystem path string is valid according to:
|
|
104
|
+
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
|
105
|
+
* @param path The path to validate.
|
|
106
|
+
* @throws If the path is invalid and the `assert` option is true.
|
|
107
|
+
*/
|
|
108
|
+
declare function isValidWin32(path: string, options?: {
|
|
109
|
+
extendedMaxLength?: boolean;
|
|
110
|
+
}): boolean;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Append string to the beginning of the filename.
|
|
114
|
+
*
|
|
115
|
+
* @example ```ts
|
|
116
|
+
* path.fileNameWithPrefix('path/to/file-name.ext', 'new-')
|
|
117
|
+
* // => path/to/new-file-name.ext
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function prefixFilename(filePath: string, prefix: string): string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns the root directory of a given path.
|
|
124
|
+
*/
|
|
125
|
+
declare function root(p: string): string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Append string to the end of the filename.
|
|
129
|
+
*
|
|
130
|
+
* @example ```ts
|
|
131
|
+
* path.suffixFilename('path/to/file-name.ext', '-old')
|
|
132
|
+
* // => path/to/file-name-old.ext
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
declare function suffixFilename(filePath: string, suffix: string): string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Solve the relative path from the process.cwd() path to the {p} path.
|
|
139
|
+
* At times we have two absolute paths, and we need to derive the relative path from one to the other.
|
|
140
|
+
* This is actually the reverse transform of path.resolve.
|
|
141
|
+
*/
|
|
142
|
+
declare function toCwdRelative(p: string): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Ensures win32 backslashes are used instead of forward slashes.
|
|
146
|
+
*/
|
|
147
|
+
declare function toWin32(p: string): string;
|
|
148
|
+
|
|
149
|
+
export { cwd, dirnameDeep, hasBasename, hasExtname, hasParentDirname, isDotFile, isExtValid, isRelative, isUnc, isValidWin32, prefixFilename, root, suffixFilename, toCwdRelative, toWin32 };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
/**
|
|
12
|
+
* Returns the absolute path of the parent directory of the given path.
|
|
13
|
+
* @param p the path
|
|
14
|
+
* @param depth how many times to get the parent directory
|
|
15
|
+
* @example dirnameDeep('a/b/c/d', 2) => 'a/b'
|
|
16
|
+
*/
|
|
17
|
+
declare function dirnameDeep(p: string, depth?: number): string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
Create a type that represents either the value or an array of the value.
|
|
21
|
+
|
|
22
|
+
@see {@link Promisable}
|
|
23
|
+
|
|
24
|
+
@example
|
|
25
|
+
```
|
|
26
|
+
import type {Arrayable} from 'type-fest';
|
|
27
|
+
|
|
28
|
+
function bundle(input: string, output: Arrayable<string>) {
|
|
29
|
+
const outputList = Array.isArray(output) ? output : [output];
|
|
30
|
+
|
|
31
|
+
// …
|
|
32
|
+
|
|
33
|
+
for (const output of outputList) {
|
|
34
|
+
console.log(`write ${input} to: ${output}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bundle('src/index.js', 'dist/index.js');
|
|
39
|
+
bundle('src/index.js', ['dist/index.cjs', 'dist/index.mjs']);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
@category Array
|
|
43
|
+
*/
|
|
44
|
+
type Arrayable<T> =
|
|
45
|
+
T
|
|
46
|
+
// TODO: Use `readonly T[]` when this issue is resolved: https://github.com/microsoft/TypeScript/issues/17002
|
|
47
|
+
| T[];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checks if a file path has any of the specified basenames.
|
|
51
|
+
*/
|
|
52
|
+
declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Checks if a file path has any of the specified file extensions.
|
|
56
|
+
*/
|
|
57
|
+
declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
|
|
58
|
+
declare namespace hasExtname {
|
|
59
|
+
var js: (tsFilepath: string) => boolean;
|
|
60
|
+
var json: (tsFilepath: string) => boolean;
|
|
61
|
+
var yaml: (tsFilepath: string) => boolean;
|
|
62
|
+
var markdown: (tsFilepath: string) => boolean;
|
|
63
|
+
var ts: (tsFilepath: string) => boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether fspath is a subpath of a parent directory with the given name.
|
|
68
|
+
*/
|
|
69
|
+
declare function hasParentDirname(fspath: string, name: string): boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Determines if a given filepath is a dotfile.
|
|
73
|
+
* @param filepath - The filepath to evaluate.
|
|
74
|
+
* @returns A boolean indicating whether the filepath is a dotfile.
|
|
75
|
+
*/
|
|
76
|
+
declare function isDotFile(filepath: string): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if a file extension is valid.
|
|
80
|
+
*
|
|
81
|
+
* Invalid:
|
|
82
|
+
* - empty string
|
|
83
|
+
* - single dot: "."
|
|
84
|
+
* - illegal characters: <>"|?*:
|
|
85
|
+
*
|
|
86
|
+
* @param ext - The file extension to check.
|
|
87
|
+
*/
|
|
88
|
+
declare function isExtValid(ext: string): boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Whether a path is a relative string, ie. not absolute.
|
|
92
|
+
*/
|
|
93
|
+
declare function isRelative(p: string): boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Determines if a given filepath is a UNC path.
|
|
97
|
+
* @param filepath - The filepath to evaluate.
|
|
98
|
+
* @returns A boolean indicating whether the filepath is a UNC path.
|
|
99
|
+
*/
|
|
100
|
+
declare function isUnc(filepath: string): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check whether a provided windows filesystem path string is valid according to:
|
|
104
|
+
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
|
105
|
+
* @param path The path to validate.
|
|
106
|
+
* @throws If the path is invalid and the `assert` option is true.
|
|
107
|
+
*/
|
|
108
|
+
declare function isValidWin32(path: string, options?: {
|
|
109
|
+
extendedMaxLength?: boolean;
|
|
110
|
+
}): boolean;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Append string to the beginning of the filename.
|
|
114
|
+
*
|
|
115
|
+
* @example ```ts
|
|
116
|
+
* path.fileNameWithPrefix('path/to/file-name.ext', 'new-')
|
|
117
|
+
* // => path/to/new-file-name.ext
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function prefixFilename(filePath: string, prefix: string): string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns the root directory of a given path.
|
|
124
|
+
*/
|
|
125
|
+
declare function root(p: string): string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Append string to the end of the filename.
|
|
129
|
+
*
|
|
130
|
+
* @example ```ts
|
|
131
|
+
* path.suffixFilename('path/to/file-name.ext', '-old')
|
|
132
|
+
* // => path/to/file-name-old.ext
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
declare function suffixFilename(filePath: string, suffix: string): string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Solve the relative path from the process.cwd() path to the {p} path.
|
|
139
|
+
* At times we have two absolute paths, and we need to derive the relative path from one to the other.
|
|
140
|
+
* This is actually the reverse transform of path.resolve.
|
|
141
|
+
*/
|
|
142
|
+
declare function toCwdRelative(p: string): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Ensures win32 backslashes are used instead of forward slashes.
|
|
146
|
+
*/
|
|
147
|
+
declare function toWin32(p: string): string;
|
|
148
|
+
|
|
149
|
+
export { cwd, dirnameDeep, hasBasename, hasExtname, hasParentDirname, isDotFile, isExtValid, isRelative, isUnc, isValidWin32, prefixFilename, root, suffixFilename, toCwdRelative, toWin32 };
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemoje/path",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Cross-platform path utilities extending upath with validation, manipulation, and inspection helpers.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"upath": "^2.0.1"
|
|
12
|
+
},
|
|
5
13
|
"keywords": [
|
|
6
14
|
"path",
|
|
7
15
|
"cross-platform",
|
|
@@ -12,17 +20,15 @@
|
|
|
12
20
|
"utilities",
|
|
13
21
|
"typescript"
|
|
14
22
|
],
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"upath": "^2.0.1"
|
|
17
|
-
},
|
|
18
|
-
"type": "module",
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
22
|
-
},
|
|
23
23
|
"main": "./lib/index.cjs",
|
|
24
24
|
"module": "./lib/index.js",
|
|
25
25
|
"types": "./lib/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"./lib/index.js",
|
|
28
|
+
"./lib/index.d.ts",
|
|
29
|
+
"./lib/index.cjs",
|
|
30
|
+
"./lib/index.d.cts"
|
|
31
|
+
],
|
|
26
32
|
"exports": {
|
|
27
33
|
".": {
|
|
28
34
|
"import": {
|
|
@@ -34,223 +40,17 @@
|
|
|
34
40
|
"default": "./lib/index.cjs"
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
|
-
"
|
|
38
|
-
"import": {
|
|
39
|
-
"types": "./lib/lib/cwd.d.ts",
|
|
40
|
-
"default": "./lib/lib/cwd.js"
|
|
41
|
-
},
|
|
42
|
-
"require": {
|
|
43
|
-
"types": "./lib/lib/cwd.d.cts",
|
|
44
|
-
"default": "./lib/lib/cwd.cjs"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"./lib/dirnameDeep": {
|
|
48
|
-
"import": {
|
|
49
|
-
"types": "./lib/lib/dirnameDeep.d.ts",
|
|
50
|
-
"default": "./lib/lib/dirnameDeep.js"
|
|
51
|
-
},
|
|
52
|
-
"require": {
|
|
53
|
-
"types": "./lib/lib/dirnameDeep.d.cts",
|
|
54
|
-
"default": "./lib/lib/dirnameDeep.cjs"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"./lib/hasBasename": {
|
|
58
|
-
"import": {
|
|
59
|
-
"types": "./lib/lib/hasBasename.d.ts",
|
|
60
|
-
"default": "./lib/lib/hasBasename.js"
|
|
61
|
-
},
|
|
62
|
-
"require": {
|
|
63
|
-
"types": "./lib/lib/hasBasename.d.cts",
|
|
64
|
-
"default": "./lib/lib/hasBasename.cjs"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"./lib/hasExtname": {
|
|
68
|
-
"import": {
|
|
69
|
-
"types": "./lib/lib/hasExtname.d.ts",
|
|
70
|
-
"default": "./lib/lib/hasExtname.js"
|
|
71
|
-
},
|
|
72
|
-
"require": {
|
|
73
|
-
"types": "./lib/lib/hasExtname.d.cts",
|
|
74
|
-
"default": "./lib/lib/hasExtname.cjs"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"./lib/hasParentDirname": {
|
|
78
|
-
"import": {
|
|
79
|
-
"types": "./lib/lib/hasParentDirname.d.ts",
|
|
80
|
-
"default": "./lib/lib/hasParentDirname.js"
|
|
81
|
-
},
|
|
82
|
-
"require": {
|
|
83
|
-
"types": "./lib/lib/hasParentDirname.d.cts",
|
|
84
|
-
"default": "./lib/lib/hasParentDirname.cjs"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"./lib/isDotFile": {
|
|
88
|
-
"import": {
|
|
89
|
-
"types": "./lib/lib/isDotFile.d.ts",
|
|
90
|
-
"default": "./lib/lib/isDotFile.js"
|
|
91
|
-
},
|
|
92
|
-
"require": {
|
|
93
|
-
"types": "./lib/lib/isDotFile.d.cts",
|
|
94
|
-
"default": "./lib/lib/isDotFile.cjs"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
"./lib/isExtValid": {
|
|
98
|
-
"import": {
|
|
99
|
-
"types": "./lib/lib/isExtValid.d.ts",
|
|
100
|
-
"default": "./lib/lib/isExtValid.js"
|
|
101
|
-
},
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./lib/lib/isExtValid.d.cts",
|
|
104
|
-
"default": "./lib/lib/isExtValid.cjs"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"./lib/isRelative": {
|
|
108
|
-
"import": {
|
|
109
|
-
"types": "./lib/lib/isRelative.d.ts",
|
|
110
|
-
"default": "./lib/lib/isRelative.js"
|
|
111
|
-
},
|
|
112
|
-
"require": {
|
|
113
|
-
"types": "./lib/lib/isRelative.d.cts",
|
|
114
|
-
"default": "./lib/lib/isRelative.cjs"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"./lib/isUnc": {
|
|
118
|
-
"import": {
|
|
119
|
-
"types": "./lib/lib/isUnc.d.ts",
|
|
120
|
-
"default": "./lib/lib/isUnc.js"
|
|
121
|
-
},
|
|
122
|
-
"require": {
|
|
123
|
-
"types": "./lib/lib/isUnc.d.cts",
|
|
124
|
-
"default": "./lib/lib/isUnc.cjs"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"./lib/isValidWin32": {
|
|
128
|
-
"import": {
|
|
129
|
-
"types": "./lib/lib/isValidWin32.d.ts",
|
|
130
|
-
"default": "./lib/lib/isValidWin32.js"
|
|
131
|
-
},
|
|
132
|
-
"require": {
|
|
133
|
-
"types": "./lib/lib/isValidWin32.d.cts",
|
|
134
|
-
"default": "./lib/lib/isValidWin32.cjs"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"./lib/prefixFilename": {
|
|
138
|
-
"import": {
|
|
139
|
-
"types": "./lib/lib/prefixFilename.d.ts",
|
|
140
|
-
"default": "./lib/lib/prefixFilename.js"
|
|
141
|
-
},
|
|
142
|
-
"require": {
|
|
143
|
-
"types": "./lib/lib/prefixFilename.d.cts",
|
|
144
|
-
"default": "./lib/lib/prefixFilename.cjs"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
"./lib/root": {
|
|
43
|
+
"./*": {
|
|
148
44
|
"import": {
|
|
149
|
-
"types": "./lib/
|
|
150
|
-
"default": "./lib/
|
|
151
|
-
},
|
|
152
|
-
"require": {
|
|
153
|
-
"types": "./lib/lib/root.d.cts",
|
|
154
|
-
"default": "./lib/lib/root.cjs"
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"./lib/suffixFilename": {
|
|
158
|
-
"import": {
|
|
159
|
-
"types": "./lib/lib/suffixFilename.d.ts",
|
|
160
|
-
"default": "./lib/lib/suffixFilename.js"
|
|
161
|
-
},
|
|
162
|
-
"require": {
|
|
163
|
-
"types": "./lib/lib/suffixFilename.d.cts",
|
|
164
|
-
"default": "./lib/lib/suffixFilename.cjs"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
"./lib/toCwdRelative": {
|
|
168
|
-
"import": {
|
|
169
|
-
"types": "./lib/lib/toCwdRelative.d.ts",
|
|
170
|
-
"default": "./lib/lib/toCwdRelative.js"
|
|
171
|
-
},
|
|
172
|
-
"require": {
|
|
173
|
-
"types": "./lib/lib/toCwdRelative.d.cts",
|
|
174
|
-
"default": "./lib/lib/toCwdRelative.cjs"
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
"./lib/toWin32": {
|
|
178
|
-
"import": {
|
|
179
|
-
"types": "./lib/lib/toWin32.d.ts",
|
|
180
|
-
"default": "./lib/lib/toWin32.js"
|
|
45
|
+
"types": "./lib/index.d.ts",
|
|
46
|
+
"default": "./lib/index.js"
|
|
181
47
|
},
|
|
182
48
|
"require": {
|
|
183
|
-
"types": "./lib/
|
|
184
|
-
"default": "./lib/
|
|
49
|
+
"types": "./lib/index.d.cts",
|
|
50
|
+
"default": "./lib/index.cjs"
|
|
185
51
|
}
|
|
186
52
|
}
|
|
187
53
|
},
|
|
188
|
-
"files": [
|
|
189
|
-
"./lib/index.js",
|
|
190
|
-
"./lib/index.d.ts",
|
|
191
|
-
"./lib/index.cjs",
|
|
192
|
-
"./lib/index.d.cts",
|
|
193
|
-
"./lib/lib/cwd.js",
|
|
194
|
-
"./lib/lib/cwd.d.ts",
|
|
195
|
-
"./lib/lib/cwd.cjs",
|
|
196
|
-
"./lib/lib/cwd.d.cts",
|
|
197
|
-
"./lib/lib/dirnameDeep.js",
|
|
198
|
-
"./lib/lib/dirnameDeep.d.ts",
|
|
199
|
-
"./lib/lib/dirnameDeep.cjs",
|
|
200
|
-
"./lib/lib/dirnameDeep.d.cts",
|
|
201
|
-
"./lib/lib/hasBasename.js",
|
|
202
|
-
"./lib/lib/hasBasename.d.ts",
|
|
203
|
-
"./lib/lib/hasBasename.cjs",
|
|
204
|
-
"./lib/lib/hasBasename.d.cts",
|
|
205
|
-
"./lib/lib/hasExtname.js",
|
|
206
|
-
"./lib/lib/hasExtname.d.ts",
|
|
207
|
-
"./lib/lib/hasExtname.cjs",
|
|
208
|
-
"./lib/lib/hasExtname.d.cts",
|
|
209
|
-
"./lib/lib/hasParentDirname.js",
|
|
210
|
-
"./lib/lib/hasParentDirname.d.ts",
|
|
211
|
-
"./lib/lib/hasParentDirname.cjs",
|
|
212
|
-
"./lib/lib/hasParentDirname.d.cts",
|
|
213
|
-
"./lib/lib/isDotFile.js",
|
|
214
|
-
"./lib/lib/isDotFile.d.ts",
|
|
215
|
-
"./lib/lib/isDotFile.cjs",
|
|
216
|
-
"./lib/lib/isDotFile.d.cts",
|
|
217
|
-
"./lib/lib/isExtValid.js",
|
|
218
|
-
"./lib/lib/isExtValid.d.ts",
|
|
219
|
-
"./lib/lib/isExtValid.cjs",
|
|
220
|
-
"./lib/lib/isExtValid.d.cts",
|
|
221
|
-
"./lib/lib/isRelative.js",
|
|
222
|
-
"./lib/lib/isRelative.d.ts",
|
|
223
|
-
"./lib/lib/isRelative.cjs",
|
|
224
|
-
"./lib/lib/isRelative.d.cts",
|
|
225
|
-
"./lib/lib/isUnc.js",
|
|
226
|
-
"./lib/lib/isUnc.d.ts",
|
|
227
|
-
"./lib/lib/isUnc.cjs",
|
|
228
|
-
"./lib/lib/isUnc.d.cts",
|
|
229
|
-
"./lib/lib/isValidWin32.js",
|
|
230
|
-
"./lib/lib/isValidWin32.d.ts",
|
|
231
|
-
"./lib/lib/isValidWin32.cjs",
|
|
232
|
-
"./lib/lib/isValidWin32.d.cts",
|
|
233
|
-
"./lib/lib/prefixFilename.js",
|
|
234
|
-
"./lib/lib/prefixFilename.d.ts",
|
|
235
|
-
"./lib/lib/prefixFilename.cjs",
|
|
236
|
-
"./lib/lib/prefixFilename.d.cts",
|
|
237
|
-
"./lib/lib/root.js",
|
|
238
|
-
"./lib/lib/root.d.ts",
|
|
239
|
-
"./lib/lib/root.cjs",
|
|
240
|
-
"./lib/lib/root.d.cts",
|
|
241
|
-
"./lib/lib/suffixFilename.js",
|
|
242
|
-
"./lib/lib/suffixFilename.d.ts",
|
|
243
|
-
"./lib/lib/suffixFilename.cjs",
|
|
244
|
-
"./lib/lib/suffixFilename.d.cts",
|
|
245
|
-
"./lib/lib/toCwdRelative.js",
|
|
246
|
-
"./lib/lib/toCwdRelative.d.ts",
|
|
247
|
-
"./lib/lib/toCwdRelative.cjs",
|
|
248
|
-
"./lib/lib/toCwdRelative.d.cts",
|
|
249
|
-
"./lib/lib/toWin32.js",
|
|
250
|
-
"./lib/lib/toWin32.d.ts",
|
|
251
|
-
"./lib/lib/toWin32.cjs",
|
|
252
|
-
"./lib/lib/toWin32.d.cts"
|
|
253
|
-
],
|
|
254
54
|
"repository": {
|
|
255
55
|
"type": "git",
|
|
256
56
|
"url": "git+https://github.com/bemoje/mono.git",
|
package/lib/lib/cwd.cjs
DELETED
|
@@ -1,16 +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 cwd(...p) {
|
|
12
|
-
return upath__default.default.joinSafe(process.cwd(), ...p);
|
|
13
|
-
}
|
|
14
|
-
__name(cwd, "cwd");
|
|
15
|
-
|
|
16
|
-
exports.cwd = cwd;
|