@oipage/cli 1.0.0-alpha.0 → 1.0.0-alpha.1

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/bin/serve.js CHANGED
@@ -4,7 +4,7 @@ const { createServer } = require('http');
4
4
  const { gzipSync, createGzip } = require("zlib");
5
5
  const packageValue = require("../package.json");
6
6
  const network = require("./tools/network.js");
7
- const mineTypes = require("./data/mineTypes.json");
7
+ const mimeTypes = require("./data/mimeTypes.json");
8
8
  const resolveImportFactory = require("./tools/resolveImport.js");
9
9
  const { replaceInCode } = require("./tools/moduleForm.js");
10
10
  const openBrowser = require("./tools/openBrowser.js");
@@ -239,7 +239,7 @@ module.exports = function (config) {
239
239
  const isCjsShim = /(^|&)oipage=cjs($|&)/.test(query);
240
240
 
241
241
  let dotName = (filePath.match(/\.([^.]+)$/) || [])[1] || "";
242
- let fileType = mineTypes[dotName]; // 文件类型
242
+ let fileType = mimeTypes[dotName]; // 文件类型
243
243
  let fileInfo = statSync(filePath);
244
244
 
245
245
  let fileModifiedTime = new Date(fileInfo.mtime).toGMTString();
@@ -1,5 +1,5 @@
1
1
  const { openSync, readSync, closeSync } = require("fs");
2
- const mineTypes = require("../data/mineTypes.json");
2
+ const mimeTypes = require("../data/mimeTypes.json");
3
3
 
4
4
  // 读取文件头部用于判断的字节数
5
5
  const CHECK_BYTES = 4096;
@@ -25,7 +25,7 @@ const TEXT_TYPES = new Set([
25
25
  */
26
26
  function isBinaryByExtension(filepath) {
27
27
  const dotName = (filepath.match(/\.([^.]+)$/) || [])[1] || "";
28
- const fileType = mineTypes[dotName];
28
+ const fileType = mimeTypes[dotName];
29
29
 
30
30
  if (!fileType) {
31
31
  // 未知类型默认视为二进制
@@ -1,7 +1,7 @@
1
1
  const { readdirSync, lstatSync, readFileSync, statSync } = require("fs");
2
2
  const { join } = require("path");
3
3
  const { formatByte, formatTime } = require("./format");
4
- const mineTypes = require("../data/mineTypes.json");
4
+ const mimeTypes = require("../data/mimeTypes.json");
5
5
 
6
6
  // HTML 实体转义,防止 XSS
7
7
  function escapeHtml(str) {
@@ -82,7 +82,7 @@ module.exports = function (filePath, url, website, name, rawIp) {
82
82
  ${formatTime(statObj.mtime)}
83
83
  </th>
84
84
  <th>
85
- ${mineTypes[dotName] || "text/plain"}
85
+ ${mimeTypes[dotName] || "text/plain"}
86
86
  </th>
87
87
  <th>
88
88
  ${formatByte(statObj.size)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oipage/cli",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0-alpha.1",
4
4
  "description": "开发快速助手,一个包含常用功能的命令行工具,旨在提升开发效率",
5
5
  "sideEffects": false,
6
6
  "main": "./src/index.js",
File without changes