broccoli-svg-optimizer
Advanced tools
Comparing version 2.0.0 to 2.1.0
12
index.js
'use strict'; | ||
const PersistentFilter = require('broccoli-persistent-filter'); | ||
const _ = require('lodash'); | ||
const stringify = require('json-stable-stringify'); | ||
const { Promise } = require('rsvp'); | ||
const stringify = require('safe-stable-stringify'); | ||
const DefaultSVGO = require('svgo'); | ||
function promisify(optimize) { | ||
return (svg) => { | ||
return svg => { | ||
return new Promise((resolve, reject) => { | ||
optimize(svg, (result) => { | ||
optimize(svg, result => { | ||
if (result.error) { | ||
@@ -43,5 +41,5 @@ reject(result.error); | ||
targetExtension: 'svg', | ||
persist: _.isUndefined(options.persist) ? true : options.persist, | ||
persist: typeof options.persist === 'undefined' ? true : options.persist, | ||
async: options.async, | ||
annotation: options.annotation | ||
annotation: options.annotation, | ||
}); | ||
@@ -48,0 +46,0 @@ |
{ | ||
"name": "broccoli-svg-optimizer", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Broccoli plugin for optimizing SVG files with SVGO", | ||
"keywords": [ | ||
"broccoli", | ||
"broccoli-plugin", | ||
"svgo" | ||
], | ||
"license": "MIT", | ||
"author": "Ivan Volti <voltidev@gmail.com>", | ||
"main": "index.js", | ||
"homepage": "https://github.com/voltidev/broccoli-svg-optimizer", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/voltidev/broccoli-svg-optimizer.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/voltidev/broccoli-svg-optimizer/issues" | ||
}, | ||
"scripts": { | ||
"lerna:lint-staged": "lint-staged", | ||
"lint": "eslint ./*.js tests", | ||
"test": "mocha tests/*test.js --timeout 1000" | ||
}, | ||
"dependencies": { | ||
"broccoli-persistent-filter": "^2.3.1", | ||
"json-stable-stringify": "^1.0.1", | ||
"lodash": "^4.17.15", | ||
"rsvp": "^4.8.5", | ||
"broccoli-persistent-filter": "^3.1.2", | ||
"safe-stable-stringify": "^2.2.0", | ||
"svgo": "1.3.0" | ||
@@ -17,52 +36,23 @@ }, | ||
"chai-as-promised": "^7.1.1", | ||
"eslint": "^6.1.0", | ||
"eslint-config-airbnb-base": "^13.2.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-node": "^9.1.0", | ||
"mocha": "^6.2.0", | ||
"husky": "^3.0.1", | ||
"lint-staged": "^9.2.1", | ||
"prettier": "^1.18.2" | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"lint-staged": ">=10", | ||
"mocha": "^9.2.0", | ||
"prettier": "^2.5.1" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm test", | ||
"lint": "eslint ./*.js tests", | ||
"nodetest": "mocha tests/*test.js --timeout 1000", | ||
"test": "npm run lint && npm run nodetest", | ||
"update-fixtures": "node ./tests/utils/update-plugin-fixtures.js" | ||
}, | ||
"main": "index.js", | ||
"author": "Ivan Votti", | ||
"license": "MIT", | ||
"homepage": "https://github.com/ivanvotti/broccoli-svg-optimizer", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ivanvotti/broccoli-svg-optimizer.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ivanvotti/broccoli-svg-optimizer/issues" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"**/*.{json,md}": [ | ||
"prettier --write", | ||
"git add" | ||
"prettier --write" | ||
], | ||
"**/*.{js,ts}": [ | ||
"eslint --fix", | ||
"git add" | ||
"eslint --cache --fix" | ||
] | ||
}, | ||
"keywords": [ | ||
"broccoli", | ||
"broccoli-plugin", | ||
"svgo" | ||
], | ||
"engines": { | ||
"node": "8.* || >= 10.*" | ||
} | ||
"node": "12.* || 14.* || >= 16" | ||
}, | ||
"gitHead": "b09bcf27f628440cfb2b9b7812905e782c771738" | ||
} |
# broccoli-svg-optimizer | ||
[![Build Status](https://travis-ci.org/ivanvotti/broccoli-svg-optimizer.svg?branch=master)](https://travis-ci.org/ivanvotti/broccoli-svg-optimizer) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/26lyufkk6ueam952/branch/master?svg=true)](https://ci.appveyor.com/project/ivanvotti/broccoli-svg-optimizer) | ||
[![Build Status](https://travis-ci.org/voltidev/broccoli-svg-optimizer.svg?branch=master)](https://travis-ci.org/voltidev/broccoli-svg-optimizer) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/26lyufkk6ueam952/branch/master?svg=true)](https://ci.appveyor.com/project/voltidev/broccoli-svg-optimizer) | ||
@@ -19,6 +19,4 @@ Broccoli plugin for optimizing SVG files by [SVGO](https://github.com/svg/svgo) with a persistent cache for fast restarts. | ||
svgoConfig: { | ||
plugins: [ | ||
{ removeTitle: true } | ||
] | ||
} | ||
plugins: [{ removeTitle: true }], | ||
}, | ||
}); | ||
@@ -45,3 +43,3 @@ ``` | ||
{ removeDesc: { removeAny: true } }, | ||
] | ||
]; | ||
} | ||
@@ -63,3 +61,3 @@ ``` | ||
let outputNode = new SVGOptimizer(inputNode, { | ||
svgoModule: require('svgo') | ||
svgoModule: require('svgo'), | ||
}); | ||
@@ -88,3 +86,3 @@ ``` | ||
GitHub [@ivanvotti](https://github.com/ivanvotti) · | ||
Twitter [@ivanvotti](https://twitter.com/ivanvotti) | ||
GitHub [@voltidev](https://github.com/voltidev) · | ||
Twitter [@voltidev](https://twitter.com/voltidev) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3
6223
56
85
1
+ Addedsafe-stable-stringify@^2.2.0
+ Addedasync-disk-cache@2.1.0(transitive)
+ Addedbroccoli-node-api@1.7.0(transitive)
+ Addedbroccoli-node-info@2.2.0(transitive)
+ Addedbroccoli-output-wrapper@3.2.5(transitive)
+ Addedbroccoli-persistent-filter@3.1.3(transitive)
+ Addedbroccoli-plugin@4.0.7(transitive)
+ Addeddebug@4.3.5(transitive)
+ Addededitions@2.3.1(transitive)
+ Addederrlop@2.2.0(transitive)
+ Addedfs-extra@8.1.0(transitive)
+ Addedfs-merger@3.2.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedistextorbinary@2.6.0(transitive)
+ Addedjsonfile@4.0.0(transitive)
+ Addedmatcher-collection@2.0.1(transitive)
+ Addedms@2.1.2(transitive)
+ Addedpromise-map-series@0.3.0(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-stable-stringify@2.4.3(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsync-disk-cache@2.1.0(transitive)
+ Addeduniversalify@0.1.2(transitive)
+ Addedwalk-sync@2.2.0(transitive)
- Removedjson-stable-stringify@^1.0.1
- Removedlodash@^4.17.15
- Removedrsvp@^4.8.5
- Removedasync-disk-cache@1.3.5(transitive)
- Removedbroccoli-persistent-filter@2.3.1(transitive)
- Removedbroccoli-plugin@1.3.1(transitive)
- Removededitions@1.3.4(transitive)
- Removedistextorbinary@2.1.0(transitive)
- Removedjson-stable-stringify@1.1.1(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedmatcher-collection@1.1.2(transitive)
- Removedsync-disk-cache@1.3.4(transitive)
- Removedwalk-sync@1.1.4(transitive)