@hot-updater/plugin-core 0.35.10 → 0.35.11

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.
@@ -1,6 +1,4 @@
1
1
  const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
- let node_path = require("node:path");
3
- node_path = require_runtime.__toESM(node_path);
4
2
  let mime = require("mime");
5
3
  mime = require_runtime.__toESM(mime);
6
4
  //#region src/compressionFormat.ts
@@ -48,8 +46,8 @@ function getCompressionMimeType(filename) {
48
46
  * @returns Content-Type string (never undefined, falls back to application/octet-stream)
49
47
  */
50
48
  function getContentType(bundlePath) {
51
- const filename = node_path.default.basename(bundlePath);
52
- return mime.default.getType(bundlePath) ?? getCompressionMimeType(filename) ?? "application/octet-stream";
49
+ const filename = bundlePath.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
50
+ return mime.default.getType(bundlePath) ?? getCompressionMimeType(filename ?? "") ?? "application/octet-stream";
53
51
  }
54
52
  //#endregion
55
53
  exports.detectCompressionFormat = detectCompressionFormat;
@@ -1,4 +1,3 @@
1
- import path from "node:path";
2
1
  import mime from "mime";
3
2
  //#region src/compressionFormat.ts
4
3
  /**
@@ -45,8 +44,8 @@ function getCompressionMimeType(filename) {
45
44
  * @returns Content-Type string (never undefined, falls back to application/octet-stream)
46
45
  */
47
46
  function getContentType(bundlePath) {
48
- const filename = path.basename(bundlePath);
49
- return mime.getType(bundlePath) ?? getCompressionMimeType(filename) ?? "application/octet-stream";
47
+ const filename = bundlePath.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
48
+ return mime.getType(bundlePath) ?? getCompressionMimeType(filename ?? "") ?? "application/octet-stream";
50
49
  }
51
50
  //#endregion
52
51
  export { detectCompressionFormat, getCompressionMimeType, getContentType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.35.10",
3
+ "version": "0.35.11",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -45,15 +45,15 @@
45
45
  "es-toolkit": "^1.32.0",
46
46
  "mime": "^4.0.4",
47
47
  "semver": "^7.7.2",
48
- "@hot-updater/core": "0.35.10",
49
- "@hot-updater/js": "0.35.10"
48
+ "@hot-updater/core": "0.35.11",
49
+ "@hot-updater/js": "0.35.11"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^20",
53
53
  "@types/semver": "^7.5.8",
54
54
  "@typescript/native": "npm:typescript@7.0.2",
55
55
  "typescript": "npm:@typescript/typescript6@6.0.2",
56
- "@hot-updater/test-utils": "0.35.10"
56
+ "@hot-updater/test-utils": "0.35.11"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsdown",