@node-minify/jsonminify 9.0.1 → 10.0.0-next.0

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/dist/index.cjs ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ default: () => src_default
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_utils = require("@node-minify/utils");
37
+ var import_jsonminify = __toESM(require("jsonminify"), 1);
38
+ var minifyJsonMinify = ({
39
+ settings,
40
+ content,
41
+ callback,
42
+ index
43
+ }) => {
44
+ const contentMinified = (0, import_jsonminify.default)(content ?? "");
45
+ if (settings && !settings.content && settings.output) {
46
+ settings.output && import_utils.utils.writeFile({
47
+ file: settings.output,
48
+ content: contentMinified,
49
+ index
50
+ });
51
+ }
52
+ if (callback) {
53
+ return callback(null, contentMinified);
54
+ }
55
+ return contentMinified;
56
+ };
57
+ minifyJsonMinify.default = minifyJsonMinify;
58
+ var src_default = minifyJsonMinify;
59
+ /*!
60
+ * node-minify
61
+ * Copyright(c) 2011-2024 Rodolphe Stoclin
62
+ * MIT Licensed
63
+ */
64
+
65
+ // fix-cjs-exports
66
+ if (module.exports.default) {
67
+ Object.assign(module.exports.default, module.exports);
68
+ module.exports = module.exports.default;
69
+ delete module.exports.default;
70
+ }
@@ -12,3 +12,4 @@ declare const minifyJsonMinify: {
12
12
  };
13
13
 
14
14
  export { minifyJsonMinify as default };
15
+ export = minifyJsonMinify
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ declare const minifyJsonMinify: {
12
12
  };
13
13
 
14
14
  export { minifyJsonMinify as default };
15
+ export = minifyJsonMinify
package/dist/index.js CHANGED
@@ -1,39 +1,15 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
-
25
1
  // src/index.ts
26
- var import_utils = require("@node-minify/utils");
27
- var import_jsonminify = __toESM(require("jsonminify"));
2
+ import { utils } from "@node-minify/utils";
3
+ import jsonminify from "jsonminify";
28
4
  var minifyJsonMinify = ({
29
5
  settings,
30
6
  content,
31
7
  callback,
32
8
  index
33
9
  }) => {
34
- const contentMinified = (0, import_jsonminify.default)(content ?? "");
10
+ const contentMinified = jsonminify(content ?? "");
35
11
  if (settings && !settings.content && settings.output) {
36
- settings.output && import_utils.utils.writeFile({
12
+ settings.output && utils.writeFile({
37
13
  file: settings.output,
38
14
  content: contentMinified,
39
15
  index
@@ -45,10 +21,12 @@ var minifyJsonMinify = ({
45
21
  return contentMinified;
46
22
  };
47
23
  minifyJsonMinify.default = minifyJsonMinify;
48
- module.exports = minifyJsonMinify;
24
+ var src_default = minifyJsonMinify;
25
+ export {
26
+ src_default as default
27
+ };
49
28
  /*!
50
29
  * node-minify
51
30
  * Copyright(c) 2011-2024 Rodolphe Stoclin
52
31
  * MIT Licensed
53
32
  */
54
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/jsonminify",
3
- "version": "9.0.1",
3
+ "version": "10.0.0-next.0",
4
4
  "description": "jsonminify plugin for @node-minify",
5
5
  "keywords": [
6
6
  "compressor",
@@ -10,23 +10,22 @@
10
10
  "jsonminify"
11
11
  ],
12
12
  "author": "Rodolphe Stoclin <srodolphe@gmail.com>",
13
- "homepage": "https://github.com/srod/node-minify/tree/master/packages/jsonminify#readme",
13
+ "homepage": "https://github.com/srod/node-minify/tree/main/packages/jsonminify#readme",
14
14
  "license": "MIT",
15
+ "type": "module",
15
16
  "engines": {
16
- "node": ">=18.0.0"
17
+ "node": ">=22.0.0"
17
18
  },
18
19
  "directories": {
19
20
  "lib": "dist",
20
21
  "test": "__tests__"
21
22
  },
22
- "main": "./dist/index.js",
23
- "module": "./dist/index.mjs",
24
- "types": "./dist/index.d.ts",
23
+ "main": "./dist/index.cjs",
25
24
  "exports": {
25
+ "./package.json": "./package.json",
26
26
  ".": {
27
- "types": "./dist/index.d.ts",
28
- "import": "./dist/index.mjs",
29
- "require": "./dist/index.js"
27
+ "import": "./dist/index.js",
28
+ "default": "./dist/index.cjs"
30
29
  }
31
30
  },
32
31
  "files": [
@@ -42,20 +41,22 @@
42
41
  "bugs": {
43
42
  "url": "https://github.com/srod/node-minify/issues"
44
43
  },
45
- "dependencies": {
46
- "jsonminify": "0.4.2",
47
- "@node-minify/utils": "9.0.1"
48
- },
49
- "devDependencies": {
50
- "@types/jsonminify": "^0.4.1",
51
- "@node-minify/types": "9.0.0"
52
- },
53
44
  "scripts": {
54
- "clean": "pnpm dlx rimraf dist",
55
- "build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
45
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean && bunx fix-tsup-cjs",
46
+ "check-exports": "attw --pack .",
47
+ "format:check": "biome check .",
56
48
  "lint": "biome lint .",
49
+ "prepublishOnly": "bun run build",
57
50
  "test": "vitest run",
58
51
  "test:ci": "vitest run --coverage",
59
52
  "test:watch": "vitest"
53
+ },
54
+ "dependencies": {
55
+ "@node-minify/utils": "workspace:*",
56
+ "jsonminify": "0.4.2"
57
+ },
58
+ "devDependencies": {
59
+ "@node-minify/types": "workspace:*",
60
+ "@types/jsonminify": "^0.4.3"
60
61
  }
61
- }
62
+ }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport jsonminify from \"jsonminify\";\n\n/**\n * Run jsonminify.\n * @param settings JsonMinify options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifyJsonMinify = ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n const contentMinified = jsonminify(content ?? \"\");\n if (settings && !settings.content && settings.output) {\n settings.output &&\n utils.writeFile({\n file: settings.output,\n content: contentMinified,\n index,\n });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyJsonMinify()`.\n */\nminifyJsonMinify.default = minifyJsonMinify;\nexport = minifyJsonMinify;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,mBAAsB;AACtB,wBAAuB;AAUvB,IAAM,mBAAmB,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,MAAuB;AACnB,QAAM,sBAAkB,kBAAAA,SAAW,WAAW,EAAE;AAChD,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,aAAS,UACL,mBAAM,UAAU;AAAA,MACZ,MAAM,SAAS;AAAA,MACf,SAAS;AAAA,MACT;AAAA,IACJ,CAAC;AAAA,EACT;AACA,MAAI,UAAU;AACV,WAAO,SAAS,MAAM,eAAe;AAAA,EACzC;AACA,SAAO;AACX;AAKA,iBAAiB,UAAU;AAC3B,iBAAS;","names":["jsonminify"]}
package/dist/index.mjs DELETED
@@ -1,40 +0,0 @@
1
- var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function __require() {
3
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
- };
5
-
6
- // src/index.ts
7
- import { utils } from "@node-minify/utils";
8
- import jsonminify from "jsonminify";
9
- var require_src = __commonJS({
10
- "src/index.ts"(exports, module) {
11
- var minifyJsonMinify = ({
12
- settings,
13
- content,
14
- callback,
15
- index
16
- }) => {
17
- const contentMinified = jsonminify(content ?? "");
18
- if (settings && !settings.content && settings.output) {
19
- settings.output && utils.writeFile({
20
- file: settings.output,
21
- content: contentMinified,
22
- index
23
- });
24
- }
25
- if (callback) {
26
- return callback(null, contentMinified);
27
- }
28
- return contentMinified;
29
- };
30
- minifyJsonMinify.default = minifyJsonMinify;
31
- module.exports = minifyJsonMinify;
32
- }
33
- });
34
- export default require_src();
35
- /*!
36
- * node-minify
37
- * Copyright(c) 2011-2024 Rodolphe Stoclin
38
- * MIT Licensed
39
- */
40
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport jsonminify from \"jsonminify\";\n\n/**\n * Run jsonminify.\n * @param settings JsonMinify options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifyJsonMinify = ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n const contentMinified = jsonminify(content ?? \"\");\n if (settings && !settings.content && settings.output) {\n settings.output &&\n utils.writeFile({\n file: settings.output,\n content: contentMinified,\n index,\n });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyJsonMinify()`.\n */\nminifyJsonMinify.default = minifyJsonMinify;\nexport = minifyJsonMinify;\n"],"mappings":";;;;;;AAUA,SAAS,aAAa;AACtB,OAAO,gBAAgB;AAXvB;AAAA;AAqBA,QAAM,mBAAmB,CAAC;AAAA,MACtB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ,MAAuB;AACnB,YAAM,kBAAkB,WAAW,WAAW,EAAE;AAChD,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,iBAAS,UACL,MAAM,UAAU;AAAA,UACZ,MAAM,SAAS;AAAA,UACf,SAAS;AAAA,UACT;AAAA,QACJ,CAAC;AAAA,MACT;AACA,UAAI,UAAU;AACV,eAAO,SAAS,MAAM,eAAe;AAAA,MACzC;AACA,aAAO;AAAA,IACX;AAKA,qBAAiB,UAAU;AAC3B,qBAAS;AAAA;AAAA;","names":[]}