Skip to content

Commit

Permalink
Remove lodash (#216)
Browse files Browse the repository at this point in the history
Remove lodash
  • Loading branch information
bezoerb authored Aug 25, 2019
2 parents 1bdb264 + 1278da1 commit 2283fdc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

const postcss = require('postcss');
const debug = require('debug')('image-inliner');
const last = require('lodash/last');
const escapeRegExp = require('lodash/escapeRegExp');
const escapeRegExp = require('escape-string-regexp');
const {getDataUriMapping} = require('./lib/image');

const DEFAULTS = {
Expand All @@ -18,7 +17,7 @@ const loop = cb => {
return decl => {
let match;
while ((match = matcher.exec(decl.value)) !== null) {
cb({decl, url: last(match)});
cb({decl, url: match[match.length - 1]});
}
};
};
Expand Down
25 changes: 22 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"dependencies": {
"asset-resolver": "^2.0.2",
"debug": "^4.1.1",
"escape-string-regexp": "^2.0.0",
"filesize": "^4.1.2",
"lodash": "^4.17.15",
"postcss": "^7.0.17",
"svgo": "^1.3.0"
},
Expand Down

0 comments on commit 2283fdc

Please sign in to comment.