@powerlines/plugin-image-compression 0.2.273 → 0.2.275

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_pretty_bytes = require('./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/pretty-bytes.cjs');
3
+ const require_pretty_bytes = require('./node_modules/.pnpm/@stryke_string-format@0.17.1/node_modules/@stryke/string-format/dist/pretty-bytes.cjs');
4
4
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
5
5
  let __stryke_fs_list_files = require("@stryke/fs/list-files");
6
6
  let __stryke_fs_read_file = require("@stryke/fs/read-file");
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { prettyBytes } from "./node_modules/.pnpm/@stryke_string-format@0.16.0/node_modules/@stryke/string-format/dist/pretty-bytes.mjs";
1
+ import { prettyBytes } from "./node_modules/.pnpm/@stryke_string-format@0.17.1/node_modules/@stryke/string-format/dist/pretty-bytes.mjs";
2
2
  import { toArray } from "@stryke/convert/to-array";
3
3
  import { listFiles } from "@stryke/fs/list-files";
4
4
  import { readFile } from "@stryke/fs/read-file";
@@ -1,5 +1,5 @@
1
1
 
2
- //#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/pretty-bytes.mjs
2
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.17.1/node_modules/@stryke/string-format/dist/pretty-bytes.mjs
3
3
  const BYTE_UNITS = [
4
4
  "B",
5
5
  "kB",
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/pretty-bytes.mjs
1
+ //#region ../../node_modules/.pnpm/@stryke+string-format@0.17.1/node_modules/@stryke/string-format/dist/pretty-bytes.mjs
2
2
  const BYTE_UNITS = [
3
3
  "B",
4
4
  "kB",
@@ -1 +1 @@
1
- {"version":3,"file":"pretty-bytes.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.16.0/node_modules/@stryke/string-format/dist/pretty-bytes.mjs"],"sourcesContent":["//#region src/pretty-bytes.ts\nconst BYTE_UNITS = [\n\t\"B\",\n\t\"kB\",\n\t\"MB\",\n\t\"GB\",\n\t\"TB\",\n\t\"PB\",\n\t\"EB\",\n\t\"ZB\",\n\t\"YB\"\n];\nconst BIBYTE_UNITS = [\n\t\"B\",\n\t\"KiB\",\n\t\"MiB\",\n\t\"GiB\",\n\t\"TiB\",\n\t\"PiB\",\n\t\"EiB\",\n\t\"ZiB\",\n\t\"YiB\"\n];\nconst BIT_UNITS = [\n\t\"b\",\n\t\"kbit\",\n\t\"Mbit\",\n\t\"Gbit\",\n\t\"Tbit\",\n\t\"Pbit\",\n\t\"Ebit\",\n\t\"Zbit\",\n\t\"Ybit\"\n];\nconst BIBIT_UNITS = [\n\t\"b\",\n\t\"kibit\",\n\t\"Mibit\",\n\t\"Gibit\",\n\t\"Tibit\",\n\t\"Pibit\",\n\t\"Eibit\",\n\t\"Zibit\",\n\t\"Yibit\"\n];\n/**\n* Formats the given number using `Number#toLocaleString`.\n*\n* @remarks\n* - If locale is a string, the value is expected to be a locale-key (for example: `de`).\n* - If locale is true, the system default locale is used for translation.\n* - If no value for locale is specified, the number is returned unmodified.\n*\n* @param number - The number to format.\n* @param locale - The locale to use for formatting the number.\n* @param options - The options to use for formatting the number.\n* @returns The formatted number.\n*/\nconst toLocaleString = (number, locale, options = {}) => {\n\tlet result = number;\n\tlet _locale = locale;\n\tif (typeof _locale === \"string\") {\n\t\tif (!_locale) _locale = process.env.STORM_LOCALE || \"en-US\";\n\t\tif (Array.isArray(_locale)) result = number?.toLocaleString(_locale, options);\n\t} else if (_locale === true || options !== void 0) result = number?.toLocaleString(void 0, options);\n\treturn String(result);\n};\n/**\n* Convert bytes to a human readable string: `1337` → `1.34 kB`.\n*\n* @param number - The number to format.\n*\n* @example\n* ```ts\n* import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n*\n* prettyBytes(1337);\n* //=> '1.34 kB'\n*\n* prettyBytes(100);\n* //=> '100 B'\n*\n* // Display file size differences\n* prettyBytes(42, {signed: true});\n* //=> '+42 B'\n*\n* // Localized output using German locale\n* prettyBytes(1337, {locale: 'de'});\n* //=> '1,34 kB'\n* ```\n*\n* @param number - The number to format.\n* @param options - The options to use.\n* @returns The formatted string.\n*/\nfunction prettyBytes(number, options) {\n\tlet _number = number;\n\tif (!Number.isFinite(_number)) throw new TypeError(`Expected a finite number, got ${typeof _number}: ${_number}`);\n\tconst opts = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options\n\t};\n\tconst UNITS = opts.bits ? opts.binary ? BIBIT_UNITS : BIT_UNITS : opts.binary ? BIBYTE_UNITS : BYTE_UNITS;\n\tconst separator = opts.space ? \" \" : \"\";\n\tif (opts.signed && _number === 0) return ` 0${separator}${UNITS[0]}`;\n\tconst isNegative = _number < 0;\n\tconst prefix = isNegative ? \"-\" : opts.signed ? \"+\" : \"\";\n\tif (isNegative) _number = -_number;\n\tlet localeOptions;\n\tif (opts.minimumFractionDigits !== void 0) localeOptions = { minimumFractionDigits: opts.minimumFractionDigits };\n\tif (opts.maximumFractionDigits !== void 0) localeOptions = {\n\t\tmaximumFractionDigits: opts.maximumFractionDigits,\n\t\t...localeOptions\n\t};\n\tif (_number < 1) return prefix + toLocaleString(_number, opts.locale, localeOptions) + separator + UNITS[0];\n\tconst exponent = Math.min(Math.floor(opts.binary ? Math.log(_number) / Math.log(1024) : Math.log10(_number) / 3), UNITS.length - 1);\n\t_number /= (opts.binary ? 1024 : 1e3) ** exponent;\n\tif (!localeOptions) _number = _number.toPrecision(3);\n\tconst numberString = toLocaleString(Number(_number), opts.locale, localeOptions);\n\tconst unit = UNITS[exponent];\n\treturn prefix + numberString + separator + unit;\n}\n\n//#endregion\nexport { prettyBytes, toLocaleString };\n//# sourceMappingURL=pretty-bytes.mjs.map"],"x_google_ignoreList":[0],"mappings":";AACA,MAAM,aAAa;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,YAAY;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,cAAc;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;AAcD,MAAM,kBAAkB,QAAQ,QAAQ,UAAU,EAAE,KAAK;CACxD,IAAI,SAAS;CACb,IAAI,UAAU;AACd,KAAI,OAAO,YAAY,UAAU;AAChC,MAAI,CAAC,QAAS,WAAU,QAAQ,IAAI,gBAAgB;AACpD,MAAI,MAAM,QAAQ,QAAQ,CAAE,UAAS,QAAQ,eAAe,SAAS,QAAQ;YACnE,YAAY,QAAQ,YAAY,KAAK,EAAG,UAAS,QAAQ,eAAe,KAAK,GAAG,QAAQ;AACnG,QAAO,OAAO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BtB,SAAS,YAAY,QAAQ,SAAS;CACrC,IAAI,UAAU;AACd,KAAI,CAAC,OAAO,SAAS,QAAQ,CAAE,OAAM,IAAI,UAAU,iCAAiC,OAAO,QAAQ,IAAI,UAAU;CACjH,MAAM,OAAO;EACZ,MAAM;EACN,QAAQ;EACR,OAAO;EACP,GAAG;EACH;CACD,MAAM,QAAQ,KAAK,OAAO,KAAK,SAAS,cAAc,YAAY,KAAK,SAAS,eAAe;CAC/F,MAAM,YAAY,KAAK,QAAQ,MAAM;AACrC,KAAI,KAAK,UAAU,YAAY,EAAG,QAAO,KAAK,YAAY,MAAM;CAChE,MAAM,aAAa,UAAU;CAC7B,MAAM,SAAS,aAAa,MAAM,KAAK,SAAS,MAAM;AACtD,KAAI,WAAY,WAAU,CAAC;CAC3B,IAAI;AACJ,KAAI,KAAK,0BAA0B,KAAK,EAAG,iBAAgB,EAAE,uBAAuB,KAAK,uBAAuB;AAChH,KAAI,KAAK,0BAA0B,KAAK,EAAG,iBAAgB;EAC1D,uBAAuB,KAAK;EAC5B,GAAG;EACH;AACD,KAAI,UAAU,EAAG,QAAO,SAAS,eAAe,SAAS,KAAK,QAAQ,cAAc,GAAG,YAAY,MAAM;CACzG,MAAM,WAAW,KAAK,IAAI,KAAK,MAAM,KAAK,SAAS,KAAK,IAAI,QAAQ,GAAG,KAAK,IAAI,KAAK,GAAG,KAAK,MAAM,QAAQ,GAAG,EAAE,EAAE,MAAM,SAAS,EAAE;AACnI,aAAY,KAAK,SAAS,OAAO,QAAQ;AACzC,KAAI,CAAC,cAAe,WAAU,QAAQ,YAAY,EAAE;CACpD,MAAM,eAAe,eAAe,OAAO,QAAQ,EAAE,KAAK,QAAQ,cAAc;CAChF,MAAM,OAAO,MAAM;AACnB,QAAO,SAAS,eAAe,YAAY"}
1
+ {"version":3,"file":"pretty-bytes.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.17.1/node_modules/@stryke/string-format/dist/pretty-bytes.mjs"],"sourcesContent":["//#region src/pretty-bytes.ts\nconst BYTE_UNITS = [\n\t\"B\",\n\t\"kB\",\n\t\"MB\",\n\t\"GB\",\n\t\"TB\",\n\t\"PB\",\n\t\"EB\",\n\t\"ZB\",\n\t\"YB\"\n];\nconst BIBYTE_UNITS = [\n\t\"B\",\n\t\"KiB\",\n\t\"MiB\",\n\t\"GiB\",\n\t\"TiB\",\n\t\"PiB\",\n\t\"EiB\",\n\t\"ZiB\",\n\t\"YiB\"\n];\nconst BIT_UNITS = [\n\t\"b\",\n\t\"kbit\",\n\t\"Mbit\",\n\t\"Gbit\",\n\t\"Tbit\",\n\t\"Pbit\",\n\t\"Ebit\",\n\t\"Zbit\",\n\t\"Ybit\"\n];\nconst BIBIT_UNITS = [\n\t\"b\",\n\t\"kibit\",\n\t\"Mibit\",\n\t\"Gibit\",\n\t\"Tibit\",\n\t\"Pibit\",\n\t\"Eibit\",\n\t\"Zibit\",\n\t\"Yibit\"\n];\n/**\n* Formats the given number using `Number#toLocaleString`.\n*\n* @remarks\n* - If locale is a string, the value is expected to be a locale-key (for example: `de`).\n* - If locale is true, the system default locale is used for translation.\n* - If no value for locale is specified, the number is returned unmodified.\n*\n* @param number - The number to format.\n* @param locale - The locale to use for formatting the number.\n* @param options - The options to use for formatting the number.\n* @returns The formatted number.\n*/\nconst toLocaleString = (number, locale, options = {}) => {\n\tlet result = number;\n\tlet _locale = locale;\n\tif (typeof _locale === \"string\") {\n\t\tif (!_locale) _locale = process.env.STORM_LOCALE || \"en-US\";\n\t\tif (Array.isArray(_locale)) result = number?.toLocaleString(_locale, options);\n\t} else if (_locale === true || options !== void 0) result = number?.toLocaleString(void 0, options);\n\treturn String(result);\n};\n/**\n* Convert bytes to a human readable string: `1337` → `1.34 kB`.\n*\n* @param number - The number to format.\n*\n* @example\n* ```ts\n* import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n*\n* prettyBytes(1337);\n* //=> '1.34 kB'\n*\n* prettyBytes(100);\n* //=> '100 B'\n*\n* // Display file size differences\n* prettyBytes(42, {signed: true});\n* //=> '+42 B'\n*\n* // Localized output using German locale\n* prettyBytes(1337, {locale: 'de'});\n* //=> '1,34 kB'\n* ```\n*\n* @param number - The number to format.\n* @param options - The options to use.\n* @returns The formatted string.\n*/\nfunction prettyBytes(number, options) {\n\tlet _number = number;\n\tif (!Number.isFinite(_number)) throw new TypeError(`Expected a finite number, got ${typeof _number}: ${_number}`);\n\tconst opts = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options\n\t};\n\tconst UNITS = opts.bits ? opts.binary ? BIBIT_UNITS : BIT_UNITS : opts.binary ? BIBYTE_UNITS : BYTE_UNITS;\n\tconst separator = opts.space ? \" \" : \"\";\n\tif (opts.signed && _number === 0) return ` 0${separator}${UNITS[0]}`;\n\tconst isNegative = _number < 0;\n\tconst prefix = isNegative ? \"-\" : opts.signed ? \"+\" : \"\";\n\tif (isNegative) _number = -_number;\n\tlet localeOptions;\n\tif (opts.minimumFractionDigits !== void 0) localeOptions = { minimumFractionDigits: opts.minimumFractionDigits };\n\tif (opts.maximumFractionDigits !== void 0) localeOptions = {\n\t\tmaximumFractionDigits: opts.maximumFractionDigits,\n\t\t...localeOptions\n\t};\n\tif (_number < 1) return prefix + toLocaleString(_number, opts.locale, localeOptions) + separator + UNITS[0];\n\tconst exponent = Math.min(Math.floor(opts.binary ? Math.log(_number) / Math.log(1024) : Math.log10(_number) / 3), UNITS.length - 1);\n\t_number /= (opts.binary ? 1024 : 1e3) ** exponent;\n\tif (!localeOptions) _number = _number.toPrecision(3);\n\tconst numberString = toLocaleString(Number(_number), opts.locale, localeOptions);\n\tconst unit = UNITS[exponent];\n\treturn prefix + numberString + separator + unit;\n}\n\n//#endregion\nexport { prettyBytes, toLocaleString };\n//# sourceMappingURL=pretty-bytes.mjs.map"],"x_google_ignoreList":[0],"mappings":";AACA,MAAM,aAAa;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,YAAY;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,cAAc;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;AAcD,MAAM,kBAAkB,QAAQ,QAAQ,UAAU,EAAE,KAAK;CACxD,IAAI,SAAS;CACb,IAAI,UAAU;AACd,KAAI,OAAO,YAAY,UAAU;AAChC,MAAI,CAAC,QAAS,WAAU,QAAQ,IAAI,gBAAgB;AACpD,MAAI,MAAM,QAAQ,QAAQ,CAAE,UAAS,QAAQ,eAAe,SAAS,QAAQ;YACnE,YAAY,QAAQ,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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-image-compression",
3
- "version": "0.2.273",
3
+ "version": "0.2.275",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to optimize images used by the project.",
6
6
  "repository": {
@@ -101,16 +101,16 @@
101
101
  "chalk": "5.6.2",
102
102
  "defu": "^6.1.4",
103
103
  "jiti": "^2.6.1",
104
- "powerlines": "^0.40.11",
104
+ "powerlines": "^0.40.13",
105
105
  "sharp": "^0.34.5",
106
106
  "svgo": "^4.0.1"
107
107
  },
108
108
  "devDependencies": {
109
- "@powerlines/plugin-plugin": "^0.12.275",
109
+ "@powerlines/plugin-plugin": "^0.12.277",
110
110
  "@storm-software/config": "^1.135.22",
111
111
  "@types/node": "^25.3.5"
112
112
  },
113
113
  "publishConfig": { "access": "public" },
114
114
  "types": "./dist/index.d.cts",
115
- "gitHead": "6e7c6508c165d754b37b0649eb1cd3a6d44c04b2"
115
+ "gitHead": "e90cf85c0287e7ce226ba8e05d6438a307ca5ac1"
116
116
  }