@kaciras-blog/image
Advanced tools
Comparing version 1.2.3 to 1.2.4
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -12,3 +31,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const zlib_1 = require("zlib"); | ||
const svgo_1 = __importDefault(require("svgo")); | ||
const svgo = __importStar(require("svgo")); | ||
const log4js_1 = require("log4js"); | ||
@@ -20,3 +39,2 @@ const filter_runner_1 = require("./filter-runner"); | ||
const brotliCompressAsync = util_1.promisify(zlib_1.brotliCompress); | ||
const svgOptimizer = new svgo_1.default(); | ||
const filters = new Map(); | ||
@@ -95,3 +113,3 @@ filters.set("type", coding_filter_1.default); | ||
if (type === "svg") { | ||
const { data } = await svgOptimizer.optimize(buffer.toString()); | ||
const { data } = svgo.optimize(buffer.toString()); | ||
tasks.push(slot.putCache({}, data)); | ||
@@ -98,0 +116,0 @@ if (data.length > SVG_COMPRESS_THRESHOLD) { |
@@ -6,3 +6,3 @@ import crypto from "crypto"; | ||
import { brotliCompress, InputType } from "zlib"; | ||
import SVGO from "svgo"; | ||
import * as svgo from "svgo"; | ||
import { getLogger } from "log4js"; | ||
@@ -17,3 +17,2 @@ import { ImageFilter, ImageTags, runFilters } from "./filter-runner"; | ||
const brotliCompressAsync = promisify<InputType, Buffer>(brotliCompress); | ||
const svgOptimizer = new SVGO(); | ||
@@ -161,3 +160,3 @@ const filters = new Map<string, ImageFilter>(); | ||
if (type === "svg") { | ||
const { data } = await svgOptimizer.optimize(buffer.toString()); | ||
const { data } = svgo.optimize(buffer.toString()); | ||
tasks.push(slot.putCache({}, data)); | ||
@@ -164,0 +163,0 @@ |
{ | ||
"name": "@kaciras-blog/image", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Image processing library for Kaciras Blog", | ||
@@ -18,8 +18,8 @@ "license": "MIT", | ||
"imagemin-gifsicle": "^7.0.0", | ||
"imagemin-pngquant": "^9.0.1", | ||
"imagemin-pngquant": "^9.0.2", | ||
"is-png": "^2.0.0", | ||
"make-error": "^1.3.6", | ||
"mozjpeg": "^7.0.0", | ||
"sharp": "^0.27.0", | ||
"svgo": "^1.3.2" | ||
"sharp": "^0.27.2", | ||
"svgo": "^2.2.1" | ||
}, | ||
@@ -31,4 +31,4 @@ "devDependencies": { | ||
"@types/sharp": "^0.27.1", | ||
"@types/svgo": "^1.3.3", | ||
"file-type": "^16.2.0" | ||
"@types/svgo": "^2.0.0", | ||
"file-type": "^16.3.0" | ||
}, | ||
@@ -38,3 +38,3 @@ "resolutions": { | ||
}, | ||
"gitHead": "bc3d0b69fb2e2b16be582af2f417d55f4853ddec" | ||
"gitHead": "b3f7e283413bacd00cbfb960484f6c5940e4721f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4291803
1558
+ Added@trysound/sax@0.2.0(transitive)
+ Addedcommander@7.2.0(transitive)
+ Addedcss-select@4.3.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@1.4.1(transitive)
+ Addeddomhandler@4.3.1(transitive)
+ Addeddomutils@2.8.0(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsvgo@2.8.0(transitive)
- Removed@types/q@1.5.8(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedarray-buffer-byte-length@1.0.2(transitive)
- Removedarray.prototype.reduce@1.0.7(transitive)
- Removedarraybuffer.prototype.slice@1.0.4(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcoa@2.0.2(transitive)
- Removedcss-select@2.1.0(transitive)
- Removedcss-select-base-adapter@0.1.1(transitive)
- Removedcss-tree@1.0.0-alpha.37(transitive)
- Removedcss-what@3.4.2(transitive)
- Removeddata-view-buffer@1.0.2(transitive)
- Removeddata-view-byte-length@1.0.2(transitive)
- Removeddata-view-byte-offset@1.0.1(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddom-serializer@0.2.2(transitive)
- Removeddomelementtype@1.3.1(transitive)
- Removeddomutils@1.7.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedes-abstract@1.23.7(transitive)
- Removedes-array-method-boxes-properly@1.0.0(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-to-primitive@1.3.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.8(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.6(transitive)
- Removedget-symbol-description@1.1.0(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-bigints@1.1.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.1.0(transitive)
- Removedis-array-buffer@3.0.5(transitive)
- Removedis-async-function@2.0.0(transitive)
- Removedis-bigint@1.1.0(transitive)
- Removedis-boolean-object@1.2.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.2(transitive)
- Removedis-date-object@1.1.0(transitive)
- Removedis-finalizationregistry@1.1.1(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number-object@1.1.1(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.4(transitive)
- Removedis-string@1.1.1(transitive)
- Removedis-symbol@1.1.1(transitive)
- Removedis-typed-array@1.1.15(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakref@1.1.0(transitive)
- Removedis-weakset@2.0.4(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmdn-data@2.0.4(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removednth-check@1.0.2(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.7(transitive)
- Removedobject.getownpropertydescriptors@2.1.8(transitive)
- Removedobject.values@1.2.1(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedq@1.5.1(transitive)
- Removedreflect.getprototypeof@1.0.9(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedsafe-array-concat@1.1.3(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedsax@1.2.4(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstring.prototype.trim@1.2.10(transitive)
- Removedstring.prototype.trimend@1.0.9(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsvgo@1.3.2(transitive)
- Removedtyped-array-buffer@1.0.3(transitive)
- Removedtyped-array-byte-length@1.0.3(transitive)
- Removedtyped-array-byte-offset@1.0.4(transitive)
- Removedtyped-array-length@1.0.7(transitive)
- Removedunbox-primitive@1.1.0(transitive)
- Removedunquote@1.1.1(transitive)
- Removedutil.promisify@1.0.1(transitive)
- Removedwhich-boxed-primitive@1.1.1(transitive)
- Removedwhich-builtin-type@1.2.1(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.18(transitive)
Updatedimagemin-pngquant@^9.0.2
Updatedsharp@^0.27.2
Updatedsvgo@^2.2.1