@swc/html 0.0.14 → 0.0.16

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.
File without changes
File without changes
package/index.js ADDED
@@ -0,0 +1,38 @@
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.minifySync = exports.minify = void 0;
27
+ const binding = __importStar(require("./binding"));
28
+ async function minify(content, options) {
29
+ return binding.minify(content, toBuffer(options !== null && options !== void 0 ? options : {}));
30
+ }
31
+ exports.minify = minify;
32
+ function minifySync(content, options) {
33
+ return binding.minifySync(content, toBuffer(options !== null && options !== void 0 ? options : {}));
34
+ }
35
+ exports.minifySync = minifySync;
36
+ function toBuffer(t) {
37
+ return Buffer.from(JSON.stringify(t));
38
+ }
package/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as binding from "./binding";
2
+
3
+ export async function minify(content: Buffer, options?: any): Promise<string> {
4
+ return binding.minify(content, toBuffer(options ?? {}));
5
+ }
6
+
7
+ export function minifySync(content: Buffer, options?: any) {
8
+ return binding.minifySync(content, toBuffer(options ?? {}));
9
+ }
10
+
11
+ function toBuffer(t: any): Buffer {
12
+ return Buffer.from(JSON.stringify(t));
13
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@swc/html",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Super-fast alternative for posthtml",
5
5
  "homepage": "https://swc.rs",
6
- "main": "./lib/index.js",
6
+ "main": "./index.js",
7
7
  "author": "강동윤 <kdy1997.dev@gmail.com>",
8
8
  "license": "Apache-2.0",
9
9
  "keywords": [
@@ -48,24 +48,24 @@
48
48
  "pack": "wasm-pack",
49
49
  "build:ts": "tsc -d",
50
50
  "build:wasm": "npm-run-all \"pack -- build ./crates/wasm --scope swc {1} -t {2} \" --",
51
- "build": "tsc -d && napi build --platform --cargo-name html_node --js ./lib/binding.js --dts ./lib/binding.d.ts -p html_node --release --cargo-cwd ../..",
52
- "build:dev": "tsc -d && napi build --platform --cargo-name html_node --js ./lib/binding.js --dts ./lib/binding.d.ts -p html_node --cargo-cwd ../..",
51
+ "build": "tsc -d && napi build --platform --cargo-name html_node --js ./binding.js --dts binding.d.ts -p html_node --release --cargo-cwd ../..",
52
+ "build:dev": "tsc -d && napi build --platform --cargo-name html_node --js ./binding.js --dts binding.d.ts -p html_node --cargo-cwd ../..",
53
53
  "test": "echo 'done!'",
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.16",
58
+ "@swc/html-darwin-x64": "0.0.16",
59
+ "@swc/html-linux-x64-gnu": "0.0.16",
60
+ "@swc/html-linux-x64-musl": "0.0.16",
61
+ "@swc/html-freebsd-x64": "0.0.16",
62
+ "@swc/html-win32-ia32-msvc": "0.0.16",
63
+ "@swc/html-linux-arm64-gnu": "0.0.16",
64
+ "@swc/html-linux-arm-gnueabihf": "0.0.16",
65
+ "@swc/html-darwin-arm64": "0.0.16",
66
+ "@swc/html-android-arm64": "0.0.16",
67
+ "@swc/html-linux-arm64-musl": "0.0.16",
68
+ "@swc/html-win32-arm64-msvc": "0.0.16",
69
+ "@swc/html-android-arm-eabi": "0.0.16"
70
70
  }
71
71
  }
package/lib/index.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.minifySync = exports.minify = void 0;
4
- const binding = require("./binding");
5
- async function minify(content, options) {
6
- return binding.minify(content, toBuffer(options));
7
- }
8
- exports.minify = minify;
9
- function minifySync(content, options) {
10
- return binding.minifySync(content, toBuffer(options));
11
- }
12
- exports.minifySync = minifySync;
13
- function toBuffer(t) {
14
- return Buffer.from(JSON.stringify(t));
15
- }
package/lib/index.ts DELETED
@@ -1,13 +0,0 @@
1
- import binding = require("./binding");
2
-
3
- export async function minify(content: Buffer, options: any): Promise<string> {
4
- return binding.minify(content, toBuffer(options));
5
- }
6
-
7
- export function minifySync(content: Buffer, options: any) {
8
- return binding.minifySync(content, toBuffer(options));
9
- }
10
-
11
- function toBuffer(t: any): Buffer {
12
- return Buffer.from(JSON.stringify(t));
13
- }