@maiyunnet/kebab 7.6.2 → 7.6.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/doc/kebab-rag.md +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/fs.js +6 -1
- package/package.json +1 -1
package/doc/kebab-rag.md
CHANGED
|
@@ -1385,7 +1385,7 @@ index/variables/VER.md
|
|
|
1385
1385
|
|
|
1386
1386
|
# Variable: VER
|
|
1387
1387
|
|
|
1388
|
-
> `const` **VER**: `"7.6.
|
|
1388
|
+
> `const` **VER**: `"7.6.3"` = `'7.6.3'`
|
|
1389
1389
|
|
|
1390
1390
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1391
1391
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '7.6.
|
|
9
|
+
export const VER = '7.6.3';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/fs.js
CHANGED
|
@@ -435,7 +435,12 @@ export async function readToResponse(path, req, res, stat) {
|
|
|
435
435
|
// --- 判断缓存以及 MIME 和编码 ---
|
|
436
436
|
let charset = '';
|
|
437
437
|
const mimeData = mime.getData(path);
|
|
438
|
-
|
|
438
|
+
// --- 特殊路径 ---
|
|
439
|
+
if (path.endsWith('/+esm')) {
|
|
440
|
+
mimeData.mime = 'application/javascript';
|
|
441
|
+
mimeData.extension = 'js';
|
|
442
|
+
}
|
|
443
|
+
if (['htm', 'html', 'css', 'js', 'mjs', 'xml', 'jpg', 'jpeg', 'svg', 'gif', 'png', 'json'].includes(mimeData.extension)) {
|
|
439
444
|
charset = '; charset=utf-8';
|
|
440
445
|
// --- 这些文件可能需要缓存 ---
|
|
441
446
|
const hash = `W/"${stat.size.toString(16)}-${stat.mtime.getTime().toString(16)}"`;
|