site-config-stack 3.1.7 → 3.1.9
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/urls.cjs +114 -1
- package/dist/urls.d.cts +1 -1
- package/dist/urls.d.mts +1 -1
- package/dist/urls.d.ts +1 -1
- package/dist/urls.mjs +114 -1
- package/package.json +1 -1
package/dist/urls.cjs
CHANGED
|
@@ -20,9 +20,122 @@ function resolveSitePath(pathOrUrl, options) {
|
|
|
20
20
|
const resolvedUrl = ufo.withBase(path, baseWithOrigin);
|
|
21
21
|
return path === "/" && !options.withBase ? ufo.withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
|
|
22
22
|
}
|
|
23
|
+
const fileExtensions = [
|
|
24
|
+
// Images
|
|
25
|
+
"jpg",
|
|
26
|
+
"jpeg",
|
|
27
|
+
"png",
|
|
28
|
+
"gif",
|
|
29
|
+
"bmp",
|
|
30
|
+
"webp",
|
|
31
|
+
"svg",
|
|
32
|
+
"ico",
|
|
33
|
+
// Documents
|
|
34
|
+
"pdf",
|
|
35
|
+
"doc",
|
|
36
|
+
"docx",
|
|
37
|
+
"xls",
|
|
38
|
+
"xlsx",
|
|
39
|
+
"ppt",
|
|
40
|
+
"pptx",
|
|
41
|
+
"txt",
|
|
42
|
+
"md",
|
|
43
|
+
"markdown",
|
|
44
|
+
// Archives
|
|
45
|
+
"zip",
|
|
46
|
+
"rar",
|
|
47
|
+
"7z",
|
|
48
|
+
"tar",
|
|
49
|
+
"gz",
|
|
50
|
+
// Audio
|
|
51
|
+
"mp3",
|
|
52
|
+
"wav",
|
|
53
|
+
"flac",
|
|
54
|
+
"ogg",
|
|
55
|
+
"opus",
|
|
56
|
+
"m4a",
|
|
57
|
+
"aac",
|
|
58
|
+
"midi",
|
|
59
|
+
"mid",
|
|
60
|
+
// Video
|
|
61
|
+
"mp4",
|
|
62
|
+
"avi",
|
|
63
|
+
"mkv",
|
|
64
|
+
"mov",
|
|
65
|
+
"wmv",
|
|
66
|
+
"flv",
|
|
67
|
+
"webm",
|
|
68
|
+
// Web
|
|
69
|
+
"html",
|
|
70
|
+
"css",
|
|
71
|
+
"js",
|
|
72
|
+
"json",
|
|
73
|
+
"xml",
|
|
74
|
+
"tsx",
|
|
75
|
+
"jsx",
|
|
76
|
+
"ts",
|
|
77
|
+
"vue",
|
|
78
|
+
"svelte",
|
|
79
|
+
"xsl",
|
|
80
|
+
"rss",
|
|
81
|
+
"atom",
|
|
82
|
+
// Programming
|
|
83
|
+
"php",
|
|
84
|
+
"py",
|
|
85
|
+
"rb",
|
|
86
|
+
"java",
|
|
87
|
+
"c",
|
|
88
|
+
"cpp",
|
|
89
|
+
"h",
|
|
90
|
+
"go",
|
|
91
|
+
// Data formats
|
|
92
|
+
"csv",
|
|
93
|
+
"tsv",
|
|
94
|
+
"sql",
|
|
95
|
+
"yaml",
|
|
96
|
+
"yml",
|
|
97
|
+
// Fonts
|
|
98
|
+
"woff",
|
|
99
|
+
"woff2",
|
|
100
|
+
"ttf",
|
|
101
|
+
"otf",
|
|
102
|
+
"eot",
|
|
103
|
+
// Executables/Binaries
|
|
104
|
+
"exe",
|
|
105
|
+
"msi",
|
|
106
|
+
"apk",
|
|
107
|
+
"ipa",
|
|
108
|
+
"dmg",
|
|
109
|
+
"iso",
|
|
110
|
+
"bin",
|
|
111
|
+
// Scripts/Config
|
|
112
|
+
"bat",
|
|
113
|
+
"cmd",
|
|
114
|
+
"sh",
|
|
115
|
+
"env",
|
|
116
|
+
"htaccess",
|
|
117
|
+
"conf",
|
|
118
|
+
"toml",
|
|
119
|
+
"ini",
|
|
120
|
+
// Package formats
|
|
121
|
+
"deb",
|
|
122
|
+
"rpm",
|
|
123
|
+
"jar",
|
|
124
|
+
"war",
|
|
125
|
+
// E-books
|
|
126
|
+
"epub",
|
|
127
|
+
"mobi",
|
|
128
|
+
// Common temporary/backup files
|
|
129
|
+
"log",
|
|
130
|
+
"tmp",
|
|
131
|
+
"bak",
|
|
132
|
+
"old",
|
|
133
|
+
"sav"
|
|
134
|
+
];
|
|
23
135
|
function isPathFile(path) {
|
|
24
136
|
const lastSegment = path.split("/").pop();
|
|
25
|
-
|
|
137
|
+
const ext = (lastSegment || path).match(/\.[0-9a-z]+$/i)?.[0];
|
|
138
|
+
return ext && fileExtensions.includes(ext.replace(".", ""));
|
|
26
139
|
}
|
|
27
140
|
function fixSlashes(trailingSlash, pathOrUrl) {
|
|
28
141
|
const $url = ufo.parseURL(pathOrUrl);
|
package/dist/urls.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ declare function resolveSitePath(pathOrUrl: string, options: {
|
|
|
5
5
|
absolute?: boolean;
|
|
6
6
|
withBase?: boolean;
|
|
7
7
|
}): string;
|
|
8
|
-
declare function isPathFile(path: string): boolean;
|
|
8
|
+
declare function isPathFile(path: string): boolean | "" | undefined;
|
|
9
9
|
declare function fixSlashes(trailingSlash: boolean | undefined, pathOrUrl: string): string;
|
|
10
10
|
|
|
11
11
|
export { fixSlashes, isPathFile, resolveSitePath };
|
package/dist/urls.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ declare function resolveSitePath(pathOrUrl: string, options: {
|
|
|
5
5
|
absolute?: boolean;
|
|
6
6
|
withBase?: boolean;
|
|
7
7
|
}): string;
|
|
8
|
-
declare function isPathFile(path: string): boolean;
|
|
8
|
+
declare function isPathFile(path: string): boolean | "" | undefined;
|
|
9
9
|
declare function fixSlashes(trailingSlash: boolean | undefined, pathOrUrl: string): string;
|
|
10
10
|
|
|
11
11
|
export { fixSlashes, isPathFile, resolveSitePath };
|
package/dist/urls.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare function resolveSitePath(pathOrUrl: string, options: {
|
|
|
5
5
|
absolute?: boolean;
|
|
6
6
|
withBase?: boolean;
|
|
7
7
|
}): string;
|
|
8
|
-
declare function isPathFile(path: string): boolean;
|
|
8
|
+
declare function isPathFile(path: string): boolean | "" | undefined;
|
|
9
9
|
declare function fixSlashes(trailingSlash: boolean | undefined, pathOrUrl: string): string;
|
|
10
10
|
|
|
11
11
|
export { fixSlashes, isPathFile, resolveSitePath };
|
package/dist/urls.mjs
CHANGED
|
@@ -18,9 +18,122 @@ function resolveSitePath(pathOrUrl, options) {
|
|
|
18
18
|
const resolvedUrl = withBase(path, baseWithOrigin);
|
|
19
19
|
return path === "/" && !options.withBase ? withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
|
|
20
20
|
}
|
|
21
|
+
const fileExtensions = [
|
|
22
|
+
// Images
|
|
23
|
+
"jpg",
|
|
24
|
+
"jpeg",
|
|
25
|
+
"png",
|
|
26
|
+
"gif",
|
|
27
|
+
"bmp",
|
|
28
|
+
"webp",
|
|
29
|
+
"svg",
|
|
30
|
+
"ico",
|
|
31
|
+
// Documents
|
|
32
|
+
"pdf",
|
|
33
|
+
"doc",
|
|
34
|
+
"docx",
|
|
35
|
+
"xls",
|
|
36
|
+
"xlsx",
|
|
37
|
+
"ppt",
|
|
38
|
+
"pptx",
|
|
39
|
+
"txt",
|
|
40
|
+
"md",
|
|
41
|
+
"markdown",
|
|
42
|
+
// Archives
|
|
43
|
+
"zip",
|
|
44
|
+
"rar",
|
|
45
|
+
"7z",
|
|
46
|
+
"tar",
|
|
47
|
+
"gz",
|
|
48
|
+
// Audio
|
|
49
|
+
"mp3",
|
|
50
|
+
"wav",
|
|
51
|
+
"flac",
|
|
52
|
+
"ogg",
|
|
53
|
+
"opus",
|
|
54
|
+
"m4a",
|
|
55
|
+
"aac",
|
|
56
|
+
"midi",
|
|
57
|
+
"mid",
|
|
58
|
+
// Video
|
|
59
|
+
"mp4",
|
|
60
|
+
"avi",
|
|
61
|
+
"mkv",
|
|
62
|
+
"mov",
|
|
63
|
+
"wmv",
|
|
64
|
+
"flv",
|
|
65
|
+
"webm",
|
|
66
|
+
// Web
|
|
67
|
+
"html",
|
|
68
|
+
"css",
|
|
69
|
+
"js",
|
|
70
|
+
"json",
|
|
71
|
+
"xml",
|
|
72
|
+
"tsx",
|
|
73
|
+
"jsx",
|
|
74
|
+
"ts",
|
|
75
|
+
"vue",
|
|
76
|
+
"svelte",
|
|
77
|
+
"xsl",
|
|
78
|
+
"rss",
|
|
79
|
+
"atom",
|
|
80
|
+
// Programming
|
|
81
|
+
"php",
|
|
82
|
+
"py",
|
|
83
|
+
"rb",
|
|
84
|
+
"java",
|
|
85
|
+
"c",
|
|
86
|
+
"cpp",
|
|
87
|
+
"h",
|
|
88
|
+
"go",
|
|
89
|
+
// Data formats
|
|
90
|
+
"csv",
|
|
91
|
+
"tsv",
|
|
92
|
+
"sql",
|
|
93
|
+
"yaml",
|
|
94
|
+
"yml",
|
|
95
|
+
// Fonts
|
|
96
|
+
"woff",
|
|
97
|
+
"woff2",
|
|
98
|
+
"ttf",
|
|
99
|
+
"otf",
|
|
100
|
+
"eot",
|
|
101
|
+
// Executables/Binaries
|
|
102
|
+
"exe",
|
|
103
|
+
"msi",
|
|
104
|
+
"apk",
|
|
105
|
+
"ipa",
|
|
106
|
+
"dmg",
|
|
107
|
+
"iso",
|
|
108
|
+
"bin",
|
|
109
|
+
// Scripts/Config
|
|
110
|
+
"bat",
|
|
111
|
+
"cmd",
|
|
112
|
+
"sh",
|
|
113
|
+
"env",
|
|
114
|
+
"htaccess",
|
|
115
|
+
"conf",
|
|
116
|
+
"toml",
|
|
117
|
+
"ini",
|
|
118
|
+
// Package formats
|
|
119
|
+
"deb",
|
|
120
|
+
"rpm",
|
|
121
|
+
"jar",
|
|
122
|
+
"war",
|
|
123
|
+
// E-books
|
|
124
|
+
"epub",
|
|
125
|
+
"mobi",
|
|
126
|
+
// Common temporary/backup files
|
|
127
|
+
"log",
|
|
128
|
+
"tmp",
|
|
129
|
+
"bak",
|
|
130
|
+
"old",
|
|
131
|
+
"sav"
|
|
132
|
+
];
|
|
21
133
|
function isPathFile(path) {
|
|
22
134
|
const lastSegment = path.split("/").pop();
|
|
23
|
-
|
|
135
|
+
const ext = (lastSegment || path).match(/\.[0-9a-z]+$/i)?.[0];
|
|
136
|
+
return ext && fileExtensions.includes(ext.replace(".", ""));
|
|
24
137
|
}
|
|
25
138
|
function fixSlashes(trailingSlash, pathOrUrl) {
|
|
26
139
|
const $url = parseURL(pathOrUrl);
|