@storm-software/eslint 0.169.93 → 0.169.95
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 +1 -1
- package/dist/chunk-4CXNUMUG.js +2 -39
- package/dist/chunk-A32JZBPO.js +2 -6
- package/dist/chunk-DJ2ZXQYV.js +4 -10
- package/dist/chunk-FXLMJ2Y5.js +3 -9
- package/dist/{chunk-DPTIR64R.js → chunk-IWQLEJ77.js} +11 -19
- package/dist/chunk-O5CGESKJ.js +20 -29
- package/dist/chunk-PWQ34SJ2.js +4 -10
- package/dist/chunk-T4LUMNGJ.js +3 -21
- package/dist/chunk-UVJN4TQE.js +5 -12
- package/dist/preset.cjs +9387 -0
- package/dist/preset.d.cts +34 -0
- package/dist/preset.js +128 -329
- package/dist/types.cjs +2 -0
- package/dist/types.d.cts +18781 -0
- package/dist/types.js +1 -3
- package/dist/utils/banner-plugin.cjs +454 -0
- package/dist/utils/banner-plugin.d.cts +6 -0
- package/dist/utils/banner-plugin.js +4 -9
- package/dist/utils/combine.cjs +9 -0
- package/dist/utils/combine.d.cts +14 -0
- package/dist/utils/combine.js +3 -6
- package/dist/utils/constants.cjs +206 -0
- package/dist/utils/constants.d.cts +36 -0
- package/dist/utils/constants.js +2 -73
- package/dist/utils/correct-paths.cjs +232 -0
- package/dist/utils/correct-paths.d.cts +30 -0
- package/dist/utils/correct-paths.js +2 -33
- package/dist/utils/find-workspace-root.cjs +201 -0
- package/dist/utils/find-workspace-root.d.cts +16 -0
- package/dist/utils/find-workspace-root.js +3 -10
- package/dist/utils/format-config.cjs +20 -0
- package/dist/utils/format-config.d.cts +5 -0
- package/dist/utils/format-config.js +2 -7
- package/dist/utils/get-file-banner.cjs +103 -0
- package/dist/utils/get-file-banner.d.cts +12 -0
- package/dist/utils/get-file-banner.js +3 -8
- package/dist/utils/helpers.cjs +87 -0
- package/dist/utils/helpers.d.cts +55 -0
- package/dist/utils/helpers.js +2 -19
- package/dist/utils/index.cjs +224 -0
- package/dist/utils/index.d.cts +3 -0
- package/dist/utils/index.js +3 -79
- package/dist/utils/tsconfig-path.cjs +152 -0
- package/dist/utils/tsconfig-path.d.cts +3 -0
- package/dist/utils/tsconfig-path.js +3 -8
- package/package.json +46 -48
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/utils/constants.ts
|
|
4
|
+
var GLOB_CODE_BLOCK = "**/*.md{,x}/*";
|
|
5
|
+
var GLOB_CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
|
|
6
|
+
var ACRONYMS_LIST = [
|
|
7
|
+
"API",
|
|
8
|
+
"ASCII",
|
|
9
|
+
"CPU",
|
|
10
|
+
"CSS",
|
|
11
|
+
"DNS",
|
|
12
|
+
"EOF",
|
|
13
|
+
"GUID",
|
|
14
|
+
"HTML",
|
|
15
|
+
"HTTP",
|
|
16
|
+
"HTTPS",
|
|
17
|
+
"ID",
|
|
18
|
+
"IP",
|
|
19
|
+
"JSON",
|
|
20
|
+
"LHS",
|
|
21
|
+
"OEM",
|
|
22
|
+
"PP",
|
|
23
|
+
"QA",
|
|
24
|
+
"RAM",
|
|
25
|
+
"RHS",
|
|
26
|
+
"RPC",
|
|
27
|
+
"RSS",
|
|
28
|
+
"SLA",
|
|
29
|
+
"SMTP",
|
|
30
|
+
"SQL",
|
|
31
|
+
"SSH",
|
|
32
|
+
"SSL",
|
|
33
|
+
"TCP",
|
|
34
|
+
"TLS",
|
|
35
|
+
"TTL",
|
|
36
|
+
"UDP",
|
|
37
|
+
"UI",
|
|
38
|
+
"UID",
|
|
39
|
+
"UUID",
|
|
40
|
+
"URI",
|
|
41
|
+
"URL",
|
|
42
|
+
"UTF",
|
|
43
|
+
"VM",
|
|
44
|
+
"XML",
|
|
45
|
+
"XSS"
|
|
46
|
+
];
|
|
47
|
+
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
48
|
+
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
49
|
+
var GLOB_JS = "**/*.?([cm])js";
|
|
50
|
+
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
51
|
+
var GLOB_TS = "**/*.?([cm])ts";
|
|
52
|
+
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
53
|
+
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
54
|
+
var GLOB_CSS = "**/*.css";
|
|
55
|
+
var GLOB_POSTCSS = "**/*.{p,post}css";
|
|
56
|
+
var GLOB_LESS = "**/*.less";
|
|
57
|
+
var GLOB_SCSS = "**/*.scss";
|
|
58
|
+
var GLOB_JSON = "**/*.json";
|
|
59
|
+
var GLOB_JSON5 = "**/*.json5";
|
|
60
|
+
var GLOB_JSONC = "**/*.jsonc";
|
|
61
|
+
var GLOB_MARKDOWN = "**/*.md";
|
|
62
|
+
var GLOB_MDX = "**/*.mdx";
|
|
63
|
+
var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
64
|
+
var GLOB_SVELTE = "**/*.svelte";
|
|
65
|
+
var GLOB_VUE = "**/*.vue";
|
|
66
|
+
var GLOB_YAML = "**/*.y?(a)ml";
|
|
67
|
+
var GLOB_TOML = "**/*.toml";
|
|
68
|
+
var GLOB_XML = "**/*.xml";
|
|
69
|
+
var GLOB_SVG = "**/*.svg";
|
|
70
|
+
var GLOB_HTML = "**/*.htm?(l)";
|
|
71
|
+
var GLOB_ASTRO = "**/*.astro";
|
|
72
|
+
var GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
73
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
74
|
+
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
75
|
+
var GLOB_TESTS = [
|
|
76
|
+
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
77
|
+
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
78
|
+
`**/*.test.${GLOB_SRC_EXT}`,
|
|
79
|
+
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
80
|
+
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
81
|
+
];
|
|
82
|
+
var GLOB_ALL_SRC = [
|
|
83
|
+
GLOB_SRC,
|
|
84
|
+
GLOB_STYLE,
|
|
85
|
+
GLOB_JSON,
|
|
86
|
+
GLOB_JSON5,
|
|
87
|
+
GLOB_MARKDOWN,
|
|
88
|
+
GLOB_MDX,
|
|
89
|
+
GLOB_SVELTE,
|
|
90
|
+
GLOB_VUE,
|
|
91
|
+
GLOB_YAML,
|
|
92
|
+
GLOB_XML,
|
|
93
|
+
GLOB_HTML
|
|
94
|
+
];
|
|
95
|
+
var GLOB_EXCLUDE = [
|
|
96
|
+
"**/.git/**",
|
|
97
|
+
"**/node_modules/**",
|
|
98
|
+
"**/src/generators/**/files/**/*",
|
|
99
|
+
"**/dist/**",
|
|
100
|
+
"**/tmp/**",
|
|
101
|
+
"**/coverage/**",
|
|
102
|
+
"**/bench/**",
|
|
103
|
+
"**/__test__/**",
|
|
104
|
+
"**/__mocks__/**",
|
|
105
|
+
"**/__generated__/**",
|
|
106
|
+
"**/.wrangler/**",
|
|
107
|
+
"**/.docusaurus/**",
|
|
108
|
+
"**/.tamagui/**",
|
|
109
|
+
"**/tamagui.css",
|
|
110
|
+
"**/.nx/**",
|
|
111
|
+
"**/.next/**",
|
|
112
|
+
"**/.storm/**",
|
|
113
|
+
"**/workbox*.js",
|
|
114
|
+
"**/sw*.js",
|
|
115
|
+
"**/service-worker.js",
|
|
116
|
+
"**/fallback*.js",
|
|
117
|
+
"**/ios/**",
|
|
118
|
+
"**/.android/**",
|
|
119
|
+
"**/.DS_Store/**",
|
|
120
|
+
"**/Thumbs.db/**",
|
|
121
|
+
"**/.cspellcache",
|
|
122
|
+
"**/package-lock.*",
|
|
123
|
+
"**/npm-lock.*",
|
|
124
|
+
"**/pnpm-lock.*",
|
|
125
|
+
"**/bun.lockb",
|
|
126
|
+
"**/cargo.lock",
|
|
127
|
+
"**/next-env.d.ts",
|
|
128
|
+
"**/CODEOWNERS",
|
|
129
|
+
"**/yarn.lock",
|
|
130
|
+
"**/jest.config.js",
|
|
131
|
+
"**/jest.setup.js",
|
|
132
|
+
"**/jest.config.ts",
|
|
133
|
+
"**/jest.setup.ts",
|
|
134
|
+
"**/jest.config.json",
|
|
135
|
+
"**/jest.setup.json",
|
|
136
|
+
"**/output",
|
|
137
|
+
"**/temp",
|
|
138
|
+
"**/.temp",
|
|
139
|
+
"**/.history",
|
|
140
|
+
"**/.vitepress/cache",
|
|
141
|
+
"**/.nuxt",
|
|
142
|
+
"**/.svelte-kit",
|
|
143
|
+
"**/.vercel",
|
|
144
|
+
"**/.changeset",
|
|
145
|
+
"**/.idea",
|
|
146
|
+
"**/.cache",
|
|
147
|
+
"**/.vite-inspect",
|
|
148
|
+
"**/.yarn",
|
|
149
|
+
"**/*.min.*",
|
|
150
|
+
"**/CHANGELOG*.md",
|
|
151
|
+
"**/CONTRIBUTING.md",
|
|
152
|
+
"**/SECURITY.md",
|
|
153
|
+
"**/CODE_OF_CONDUCT.md",
|
|
154
|
+
"**/PULL_REQUEST_TEMPLATE.md",
|
|
155
|
+
"**/LICENSE*",
|
|
156
|
+
"**/__snapshots__",
|
|
157
|
+
"**/auto-import?(s).d.ts",
|
|
158
|
+
"**/components.d.ts",
|
|
159
|
+
"**/vite.config.*.timestamp-*",
|
|
160
|
+
"**/webpack.config.*.timestamp-*",
|
|
161
|
+
"**/rollup.config.*.timestamp-*",
|
|
162
|
+
"**/src/executors/*/*.schema.*",
|
|
163
|
+
"**/src/executors/*/schema.d.ts",
|
|
164
|
+
"**/src/executors/*/schema.json",
|
|
165
|
+
"**/src/executors/*/schema.md",
|
|
166
|
+
"**/src/generators/*/files/**",
|
|
167
|
+
"**/src/generators/*/*.schema.*",
|
|
168
|
+
"**/src/generators/*/schema.d.ts",
|
|
169
|
+
"**/src/generators/*/schema.json",
|
|
170
|
+
"**/src/generators/*/schema.md"
|
|
171
|
+
];
|
|
172
|
+
|
|
173
|
+
exports.ACRONYMS_LIST = ACRONYMS_LIST;
|
|
174
|
+
exports.GLOB_ALL_SRC = GLOB_ALL_SRC;
|
|
175
|
+
exports.GLOB_ASTRO = GLOB_ASTRO;
|
|
176
|
+
exports.GLOB_ASTRO_TS = GLOB_ASTRO_TS;
|
|
177
|
+
exports.GLOB_CODE_BLOCK = GLOB_CODE_BLOCK;
|
|
178
|
+
exports.GLOB_CODE_FILE = GLOB_CODE_FILE;
|
|
179
|
+
exports.GLOB_CSS = GLOB_CSS;
|
|
180
|
+
exports.GLOB_EXCLUDE = GLOB_EXCLUDE;
|
|
181
|
+
exports.GLOB_GRAPHQL = GLOB_GRAPHQL;
|
|
182
|
+
exports.GLOB_HTML = GLOB_HTML;
|
|
183
|
+
exports.GLOB_JS = GLOB_JS;
|
|
184
|
+
exports.GLOB_JSON = GLOB_JSON;
|
|
185
|
+
exports.GLOB_JSON5 = GLOB_JSON5;
|
|
186
|
+
exports.GLOB_JSONC = GLOB_JSONC;
|
|
187
|
+
exports.GLOB_JSX = GLOB_JSX;
|
|
188
|
+
exports.GLOB_LESS = GLOB_LESS;
|
|
189
|
+
exports.GLOB_MARKDOWN = GLOB_MARKDOWN;
|
|
190
|
+
exports.GLOB_MARKDOWN_CODE = GLOB_MARKDOWN_CODE;
|
|
191
|
+
exports.GLOB_MARKDOWN_IN_MARKDOWN = GLOB_MARKDOWN_IN_MARKDOWN;
|
|
192
|
+
exports.GLOB_MDX = GLOB_MDX;
|
|
193
|
+
exports.GLOB_POSTCSS = GLOB_POSTCSS;
|
|
194
|
+
exports.GLOB_SCSS = GLOB_SCSS;
|
|
195
|
+
exports.GLOB_SRC = GLOB_SRC;
|
|
196
|
+
exports.GLOB_SRC_EXT = GLOB_SRC_EXT;
|
|
197
|
+
exports.GLOB_STYLE = GLOB_STYLE;
|
|
198
|
+
exports.GLOB_SVELTE = GLOB_SVELTE;
|
|
199
|
+
exports.GLOB_SVG = GLOB_SVG;
|
|
200
|
+
exports.GLOB_TESTS = GLOB_TESTS;
|
|
201
|
+
exports.GLOB_TOML = GLOB_TOML;
|
|
202
|
+
exports.GLOB_TS = GLOB_TS;
|
|
203
|
+
exports.GLOB_TSX = GLOB_TSX;
|
|
204
|
+
exports.GLOB_VUE = GLOB_VUE;
|
|
205
|
+
exports.GLOB_XML = GLOB_XML;
|
|
206
|
+
exports.GLOB_YAML = GLOB_YAML;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare const GLOB_CODE_BLOCK = "**/*.md{,x}/*";
|
|
2
|
+
declare const GLOB_CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
|
|
3
|
+
declare const ACRONYMS_LIST: string[];
|
|
4
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
5
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
6
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
7
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
8
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
9
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
10
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
11
|
+
declare const GLOB_CSS = "**/*.css";
|
|
12
|
+
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
13
|
+
declare const GLOB_LESS = "**/*.less";
|
|
14
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
15
|
+
declare const GLOB_JSON = "**/*.json";
|
|
16
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
17
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
18
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
19
|
+
declare const GLOB_MDX = "**/*.mdx";
|
|
20
|
+
declare const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
21
|
+
declare const GLOB_SVELTE = "**/*.svelte";
|
|
22
|
+
declare const GLOB_VUE = "**/*.vue";
|
|
23
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
24
|
+
declare const GLOB_TOML = "**/*.toml";
|
|
25
|
+
declare const GLOB_XML = "**/*.xml";
|
|
26
|
+
declare const GLOB_SVG = "**/*.svg";
|
|
27
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
28
|
+
declare const GLOB_ASTRO = "**/*.astro";
|
|
29
|
+
declare const GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
30
|
+
declare const GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
31
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
32
|
+
declare const GLOB_TESTS: string[];
|
|
33
|
+
declare const GLOB_ALL_SRC: string[];
|
|
34
|
+
declare const GLOB_EXCLUDE: string[];
|
|
35
|
+
|
|
36
|
+
export { ACRONYMS_LIST, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CODE_BLOCK, GLOB_CODE_FILE, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML };
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
GLOB_ALL_SRC,
|
|
4
|
-
GLOB_ASTRO,
|
|
5
|
-
GLOB_ASTRO_TS,
|
|
6
|
-
GLOB_CODE_BLOCK,
|
|
7
|
-
GLOB_CODE_FILE,
|
|
8
|
-
GLOB_CSS,
|
|
9
|
-
GLOB_EXCLUDE,
|
|
10
|
-
GLOB_GRAPHQL,
|
|
11
|
-
GLOB_HTML,
|
|
12
|
-
GLOB_JS,
|
|
13
|
-
GLOB_JSON,
|
|
14
|
-
GLOB_JSON5,
|
|
15
|
-
GLOB_JSONC,
|
|
16
|
-
GLOB_JSX,
|
|
17
|
-
GLOB_LESS,
|
|
18
|
-
GLOB_MARKDOWN,
|
|
19
|
-
GLOB_MARKDOWN_CODE,
|
|
20
|
-
GLOB_MARKDOWN_IN_MARKDOWN,
|
|
21
|
-
GLOB_MDX,
|
|
22
|
-
GLOB_POSTCSS,
|
|
23
|
-
GLOB_SCSS,
|
|
24
|
-
GLOB_SRC,
|
|
25
|
-
GLOB_SRC_EXT,
|
|
26
|
-
GLOB_STYLE,
|
|
27
|
-
GLOB_SVELTE,
|
|
28
|
-
GLOB_SVG,
|
|
29
|
-
GLOB_TESTS,
|
|
30
|
-
GLOB_TOML,
|
|
31
|
-
GLOB_TS,
|
|
32
|
-
GLOB_TSX,
|
|
33
|
-
GLOB_VUE,
|
|
34
|
-
GLOB_XML,
|
|
35
|
-
GLOB_YAML
|
|
36
|
-
} from "../chunk-4CXNUMUG.js";
|
|
37
|
-
import "../chunk-PWQ34SJ2.js";
|
|
38
|
-
export {
|
|
39
|
-
ACRONYMS_LIST,
|
|
40
|
-
GLOB_ALL_SRC,
|
|
41
|
-
GLOB_ASTRO,
|
|
42
|
-
GLOB_ASTRO_TS,
|
|
43
|
-
GLOB_CODE_BLOCK,
|
|
44
|
-
GLOB_CODE_FILE,
|
|
45
|
-
GLOB_CSS,
|
|
46
|
-
GLOB_EXCLUDE,
|
|
47
|
-
GLOB_GRAPHQL,
|
|
48
|
-
GLOB_HTML,
|
|
49
|
-
GLOB_JS,
|
|
50
|
-
GLOB_JSON,
|
|
51
|
-
GLOB_JSON5,
|
|
52
|
-
GLOB_JSONC,
|
|
53
|
-
GLOB_JSX,
|
|
54
|
-
GLOB_LESS,
|
|
55
|
-
GLOB_MARKDOWN,
|
|
56
|
-
GLOB_MARKDOWN_CODE,
|
|
57
|
-
GLOB_MARKDOWN_IN_MARKDOWN,
|
|
58
|
-
GLOB_MDX,
|
|
59
|
-
GLOB_POSTCSS,
|
|
60
|
-
GLOB_SCSS,
|
|
61
|
-
GLOB_SRC,
|
|
62
|
-
GLOB_SRC_EXT,
|
|
63
|
-
GLOB_STYLE,
|
|
64
|
-
GLOB_SVELTE,
|
|
65
|
-
GLOB_SVG,
|
|
66
|
-
GLOB_TESTS,
|
|
67
|
-
GLOB_TOML,
|
|
68
|
-
GLOB_TS,
|
|
69
|
-
GLOB_TSX,
|
|
70
|
-
GLOB_VUE,
|
|
71
|
-
GLOB_XML,
|
|
72
|
-
GLOB_YAML
|
|
73
|
-
};
|
|
1
|
+
export { ACRONYMS_LIST, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CODE_BLOCK, GLOB_CODE_FILE, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from '../chunk-4CXNUMUG.js';
|
|
2
|
+
import '../chunk-PWQ34SJ2.js';
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/utils/correct-paths.ts
|
|
4
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
5
|
+
function normalizeWindowsPath(input = "") {
|
|
6
|
+
if (!input) {
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
10
|
+
}
|
|
11
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
12
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
13
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
14
|
+
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
15
|
+
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
16
|
+
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
17
|
+
var sep = "/";
|
|
18
|
+
var correctPaths = function(path) {
|
|
19
|
+
if (!path || path.length === 0) {
|
|
20
|
+
return ".";
|
|
21
|
+
}
|
|
22
|
+
path = normalizeWindowsPath(path);
|
|
23
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
24
|
+
const isPathAbsolute = isAbsolute(path);
|
|
25
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
26
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
27
|
+
if (path.length === 0) {
|
|
28
|
+
if (isPathAbsolute) {
|
|
29
|
+
return "/";
|
|
30
|
+
}
|
|
31
|
+
return trailingSeparator ? "./" : ".";
|
|
32
|
+
}
|
|
33
|
+
if (trailingSeparator) {
|
|
34
|
+
path += "/";
|
|
35
|
+
}
|
|
36
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
37
|
+
path += "/";
|
|
38
|
+
}
|
|
39
|
+
if (isUNCPath) {
|
|
40
|
+
if (!isPathAbsolute) {
|
|
41
|
+
return `//./${path}`;
|
|
42
|
+
}
|
|
43
|
+
return `//${path}`;
|
|
44
|
+
}
|
|
45
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
46
|
+
};
|
|
47
|
+
var joinPaths = function(...segments) {
|
|
48
|
+
let path = "";
|
|
49
|
+
for (const seg of segments) {
|
|
50
|
+
if (!seg) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (path.length > 0) {
|
|
54
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
55
|
+
const segLeading = seg[0] === "/";
|
|
56
|
+
const both = pathTrailing && segLeading;
|
|
57
|
+
if (both) {
|
|
58
|
+
path += seg.slice(1);
|
|
59
|
+
} else {
|
|
60
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
path += seg;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return correctPaths(path);
|
|
67
|
+
};
|
|
68
|
+
function cwd() {
|
|
69
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
70
|
+
return process.cwd().replace(/\\/g, "/");
|
|
71
|
+
}
|
|
72
|
+
return "/";
|
|
73
|
+
}
|
|
74
|
+
var resolve = function(...arguments_) {
|
|
75
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
76
|
+
let resolvedPath = "";
|
|
77
|
+
let resolvedAbsolute = false;
|
|
78
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
79
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
80
|
+
if (!path || path.length === 0) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
84
|
+
resolvedAbsolute = isAbsolute(path);
|
|
85
|
+
}
|
|
86
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
87
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
88
|
+
return `/${resolvedPath}`;
|
|
89
|
+
}
|
|
90
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
91
|
+
};
|
|
92
|
+
function normalizeString(path, allowAboveRoot) {
|
|
93
|
+
let res = "";
|
|
94
|
+
let lastSegmentLength = 0;
|
|
95
|
+
let lastSlash = -1;
|
|
96
|
+
let dots = 0;
|
|
97
|
+
let char = null;
|
|
98
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
99
|
+
if (index < path.length) {
|
|
100
|
+
char = path[index];
|
|
101
|
+
} else if (char === "/") {
|
|
102
|
+
break;
|
|
103
|
+
} else {
|
|
104
|
+
char = "/";
|
|
105
|
+
}
|
|
106
|
+
if (char === "/") {
|
|
107
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
108
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
109
|
+
if (res.length > 2) {
|
|
110
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
111
|
+
if (lastSlashIndex === -1) {
|
|
112
|
+
res = "";
|
|
113
|
+
lastSegmentLength = 0;
|
|
114
|
+
} else {
|
|
115
|
+
res = res.slice(0, lastSlashIndex);
|
|
116
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
117
|
+
}
|
|
118
|
+
lastSlash = index;
|
|
119
|
+
dots = 0;
|
|
120
|
+
continue;
|
|
121
|
+
} else if (res.length > 0) {
|
|
122
|
+
res = "";
|
|
123
|
+
lastSegmentLength = 0;
|
|
124
|
+
lastSlash = index;
|
|
125
|
+
dots = 0;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (allowAboveRoot) {
|
|
130
|
+
res += res.length > 0 ? "/.." : "..";
|
|
131
|
+
lastSegmentLength = 2;
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
if (res.length > 0) {
|
|
135
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
136
|
+
} else {
|
|
137
|
+
res = path.slice(lastSlash + 1, index);
|
|
138
|
+
}
|
|
139
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
140
|
+
}
|
|
141
|
+
lastSlash = index;
|
|
142
|
+
dots = 0;
|
|
143
|
+
} else if (char === "." && dots !== -1) {
|
|
144
|
+
++dots;
|
|
145
|
+
} else {
|
|
146
|
+
dots = -1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return res;
|
|
150
|
+
}
|
|
151
|
+
var isAbsolute = function(p) {
|
|
152
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
153
|
+
};
|
|
154
|
+
var toNamespacedPath = function(p) {
|
|
155
|
+
return normalizeWindowsPath(p);
|
|
156
|
+
};
|
|
157
|
+
var extname = function(p) {
|
|
158
|
+
if (p === "..") return "";
|
|
159
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
160
|
+
return match && match[1] || "";
|
|
161
|
+
};
|
|
162
|
+
var relative = function(from, to) {
|
|
163
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
164
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
165
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
166
|
+
return _to.join("/");
|
|
167
|
+
}
|
|
168
|
+
const _fromCopy = [..._from];
|
|
169
|
+
for (const segment of _fromCopy) {
|
|
170
|
+
if (_to[0] !== segment) {
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
_from.shift();
|
|
174
|
+
_to.shift();
|
|
175
|
+
}
|
|
176
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
177
|
+
};
|
|
178
|
+
var dirname = function(p) {
|
|
179
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
180
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
181
|
+
segments[0] += "/";
|
|
182
|
+
}
|
|
183
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
184
|
+
};
|
|
185
|
+
var format = function(p) {
|
|
186
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
187
|
+
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
188
|
+
Boolean
|
|
189
|
+
);
|
|
190
|
+
return normalizeWindowsPath(
|
|
191
|
+
p.root ? resolve(...segments) : segments.join("/")
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
var basename = function(p, extension) {
|
|
195
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
196
|
+
let lastSegment = "";
|
|
197
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
198
|
+
const val = segments[i];
|
|
199
|
+
if (val) {
|
|
200
|
+
lastSegment = val;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
205
|
+
};
|
|
206
|
+
var parse = function(p) {
|
|
207
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
208
|
+
const base = basename(p);
|
|
209
|
+
const extension = extname(base);
|
|
210
|
+
return {
|
|
211
|
+
root,
|
|
212
|
+
dir: dirname(p),
|
|
213
|
+
base,
|
|
214
|
+
ext: extension,
|
|
215
|
+
name: base.slice(0, base.length - extension.length)
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
exports.basename = basename;
|
|
220
|
+
exports.correctPaths = correctPaths;
|
|
221
|
+
exports.dirname = dirname;
|
|
222
|
+
exports.extname = extname;
|
|
223
|
+
exports.format = format;
|
|
224
|
+
exports.isAbsolute = isAbsolute;
|
|
225
|
+
exports.joinPaths = joinPaths;
|
|
226
|
+
exports.normalizeString = normalizeString;
|
|
227
|
+
exports.normalizeWindowsPath = normalizeWindowsPath;
|
|
228
|
+
exports.parse = parse;
|
|
229
|
+
exports.relative = relative;
|
|
230
|
+
exports.resolve = resolve;
|
|
231
|
+
exports.sep = sep;
|
|
232
|
+
exports.toNamespacedPath = toNamespacedPath;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
declare function normalizeWindowsPath(input?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Constant for path separator.
|
|
6
|
+
*
|
|
7
|
+
* Always equals to `"/"`.
|
|
8
|
+
*/
|
|
9
|
+
declare const sep = "/";
|
|
10
|
+
declare const correctPaths: (path?: string) => string;
|
|
11
|
+
declare const joinPaths: typeof path.join;
|
|
12
|
+
declare const resolve: typeof path.resolve;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
15
|
+
*
|
|
16
|
+
* @param path - The path to normalise.
|
|
17
|
+
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
18
|
+
* @returns the normalised path string.
|
|
19
|
+
*/
|
|
20
|
+
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
|
21
|
+
declare const isAbsolute: typeof path.isAbsolute;
|
|
22
|
+
declare const toNamespacedPath: typeof path.toNamespacedPath;
|
|
23
|
+
declare const extname: typeof path.extname;
|
|
24
|
+
declare const relative: typeof path.relative;
|
|
25
|
+
declare const dirname: typeof path.dirname;
|
|
26
|
+
declare const format: typeof path.format;
|
|
27
|
+
declare const basename: typeof path.basename;
|
|
28
|
+
declare const parse: typeof path.parse;
|
|
29
|
+
|
|
30
|
+
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath };
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
correctPaths,
|
|
4
|
-
dirname,
|
|
5
|
-
extname,
|
|
6
|
-
format,
|
|
7
|
-
isAbsolute,
|
|
8
|
-
joinPaths,
|
|
9
|
-
normalizeString,
|
|
10
|
-
normalizeWindowsPath,
|
|
11
|
-
parse,
|
|
12
|
-
relative,
|
|
13
|
-
resolve,
|
|
14
|
-
sep,
|
|
15
|
-
toNamespacedPath
|
|
16
|
-
} from "../chunk-T4LUMNGJ.js";
|
|
17
|
-
import "../chunk-PWQ34SJ2.js";
|
|
18
|
-
export {
|
|
19
|
-
basename,
|
|
20
|
-
correctPaths,
|
|
21
|
-
dirname,
|
|
22
|
-
extname,
|
|
23
|
-
format,
|
|
24
|
-
isAbsolute,
|
|
25
|
-
joinPaths,
|
|
26
|
-
normalizeString,
|
|
27
|
-
normalizeWindowsPath,
|
|
28
|
-
parse,
|
|
29
|
-
relative,
|
|
30
|
-
resolve,
|
|
31
|
-
sep,
|
|
32
|
-
toNamespacedPath
|
|
33
|
-
};
|
|
1
|
+
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from '../chunk-T4LUMNGJ.js';
|
|
2
|
+
import '../chunk-PWQ34SJ2.js';
|