@swc/html 0.0.14 → 0.0.15

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/lib/index.js CHANGED
@@ -1,13 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.minifySync = exports.minify = void 0;
4
- const binding = require("./binding");
27
+ const binding = __importStar(require("./binding"));
5
28
  async function minify(content, options) {
6
- return binding.minify(content, toBuffer(options));
29
+ return binding.minify(content, toBuffer(options !== null && options !== void 0 ? options : {}));
7
30
  }
8
31
  exports.minify = minify;
9
32
  function minifySync(content, options) {
10
- return binding.minifySync(content, toBuffer(options));
33
+ return binding.minifySync(content, toBuffer(options !== null && options !== void 0 ? options : {}));
11
34
  }
12
35
  exports.minifySync = minifySync;
13
36
  function toBuffer(t) {
package/lib/index.ts CHANGED
@@ -1,11 +1,11 @@
1
- import binding = require("./binding");
1
+ import * as binding from "./binding";
2
2
 
3
- export async function minify(content: Buffer, options: any): Promise<string> {
4
- return binding.minify(content, toBuffer(options));
3
+ export async function minify(content: Buffer, options?: any): Promise<string> {
4
+ return binding.minify(content, toBuffer(options ?? {}));
5
5
  }
6
6
 
7
- export function minifySync(content: Buffer, options: any) {
8
- return binding.minifySync(content, toBuffer(options));
7
+ export function minifySync(content: Buffer, options?: any) {
8
+ return binding.minifySync(content, toBuffer(options ?? {}));
9
9
  }
10
10
 
11
11
  function toBuffer(t: any): Buffer {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/html",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Super-fast alternative for posthtml",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./lib/index.js",
@@ -54,18 +54,18 @@
54
54
  "version": "napi version -p scripts/npm"
55
55
  },
56
56
  "optionalDependencies": {
57
- "@swc/html-win32-x64-msvc": "0.0.14",
58
- "@swc/html-darwin-x64": "0.0.14",
59
- "@swc/html-linux-x64-gnu": "0.0.14",
60
- "@swc/html-linux-x64-musl": "0.0.14",
61
- "@swc/html-freebsd-x64": "0.0.14",
62
- "@swc/html-win32-ia32-msvc": "0.0.14",
63
- "@swc/html-linux-arm64-gnu": "0.0.14",
64
- "@swc/html-linux-arm-gnueabihf": "0.0.14",
65
- "@swc/html-darwin-arm64": "0.0.14",
66
- "@swc/html-android-arm64": "0.0.14",
67
- "@swc/html-linux-arm64-musl": "0.0.14",
68
- "@swc/html-win32-arm64-msvc": "0.0.14",
69
- "@swc/html-android-arm-eabi": "0.0.14"
57
+ "@swc/html-win32-x64-msvc": "0.0.15",
58
+ "@swc/html-darwin-x64": "0.0.15",
59
+ "@swc/html-linux-x64-gnu": "0.0.15",
60
+ "@swc/html-linux-x64-musl": "0.0.15",
61
+ "@swc/html-freebsd-x64": "0.0.15",
62
+ "@swc/html-win32-ia32-msvc": "0.0.15",
63
+ "@swc/html-linux-arm64-gnu": "0.0.15",
64
+ "@swc/html-linux-arm-gnueabihf": "0.0.15",
65
+ "@swc/html-darwin-arm64": "0.0.15",
66
+ "@swc/html-android-arm64": "0.0.15",
67
+ "@swc/html-linux-arm64-musl": "0.0.15",
68
+ "@swc/html-win32-arm64-msvc": "0.0.15",
69
+ "@swc/html-android-arm-eabi": "0.0.15"
70
70
  }
71
71
  }