@swc/core 1.12.3 → 1.12.4

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +11 -11
package/index.js CHANGED
@@ -98,7 +98,7 @@ class Compiler {
98
98
  minify(src, opts, extras) {
99
99
  return __awaiter(this, void 0, void 0, function* () {
100
100
  if (bindings) {
101
- return bindings.minify(Buffer.from(typeof src === 'object' ? JSON.stringify(src) : src), toBuffer(opts !== null && opts !== void 0 ? opts : {}), typeof src === 'object', extras !== null && extras !== void 0 ? extras : {});
101
+ return bindings.minify(Buffer.from(!Buffer.isBuffer(src) && typeof src === 'object' ? JSON.stringify(src) : src), toBuffer(opts !== null && opts !== void 0 ? opts : {}), !Buffer.isBuffer(src) && typeof src === 'object', extras !== null && extras !== void 0 ? extras : {});
102
102
  }
103
103
  else if (fallbackBindings) {
104
104
  return fallbackBindings.minify(src, opts);
@@ -108,7 +108,7 @@ class Compiler {
108
108
  }
109
109
  minifySync(src, opts, extras) {
110
110
  if (bindings) {
111
- return bindings.minifySync(Buffer.from(typeof src === 'object' ? JSON.stringify(src) : src), toBuffer(opts !== null && opts !== void 0 ? opts : {}), typeof src === 'object', extras !== null && extras !== void 0 ? extras : {});
111
+ return bindings.minifySync(Buffer.from(!Buffer.isBuffer(src) && typeof src === 'object' ? JSON.stringify(src) : src), toBuffer(opts !== null && opts !== void 0 ? opts : {}), !Buffer.isBuffer(src) && typeof src === 'object', extras !== null && extras !== void 0 ? extras : {});
112
112
  }
113
113
  else if (fallbackBindings) {
114
114
  return fallbackBindings.minifySync(src, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -100,15 +100,15 @@
100
100
  "typescript": "^5.3.3"
101
101
  },
102
102
  "optionalDependencies": {
103
- "@swc/core-darwin-x64": "1.12.3",
104
- "@swc/core-win32-x64-msvc": "1.12.3",
105
- "@swc/core-linux-x64-gnu": "1.12.3",
106
- "@swc/core-linux-x64-musl": "1.12.3",
107
- "@swc/core-win32-ia32-msvc": "1.12.3",
108
- "@swc/core-linux-arm-gnueabihf": "1.12.3",
109
- "@swc/core-darwin-arm64": "1.12.3",
110
- "@swc/core-linux-arm64-gnu": "1.12.3",
111
- "@swc/core-linux-arm64-musl": "1.12.3",
112
- "@swc/core-win32-arm64-msvc": "1.12.3"
103
+ "@swc/core-darwin-x64": "1.12.4",
104
+ "@swc/core-win32-x64-msvc": "1.12.4",
105
+ "@swc/core-linux-x64-gnu": "1.12.4",
106
+ "@swc/core-linux-x64-musl": "1.12.4",
107
+ "@swc/core-win32-ia32-msvc": "1.12.4",
108
+ "@swc/core-linux-arm-gnueabihf": "1.12.4",
109
+ "@swc/core-darwin-arm64": "1.12.4",
110
+ "@swc/core-linux-arm64-gnu": "1.12.4",
111
+ "@swc/core-linux-arm64-musl": "1.12.4",
112
+ "@swc/core-win32-arm64-msvc": "1.12.4"
113
113
  }
114
114
  }