Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Upgrading loader utils to fix deprecation warning #72

Merged
merged 1 commit into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ var regexSequences = [
[/\> \</g, "><"] // remove whitespace between tags
];

function getExtractedSVG(svgStr, query) {
function getExtractedSVG(svgStr, options) {
var config;
// interpolate hashes in classPrefix
if(!!query) {
config = assign({}, query);
if(!!options) {
config = assign({}, options);

if (!!config.classPrefix) {
const name = config.classPrefix === true ? '__[hash:base64:7]__' : config.classPrefix;
Expand Down Expand Up @@ -60,9 +60,9 @@ function SVGInlineLoader(content) {
this.cacheable && this.cacheable();
this.value = content;
// Configuration
var query = loaderUtils.parseQuery(this.query);
var options = loaderUtils.getOptions(this);

return "module.exports = " + JSON.stringify(getExtractedSVG(content, query));
return "module.exports = " + JSON.stringify(getExtractedSVG(content, options));
}

SVGInlineLoader.getExtractedSVG = getExtractedSVG;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"release": "standard-version"
},
"dependencies": {
"loader-utils": "^0.2.11",
"loader-utils": "^1.1.0",
"object-assign": "^4.0.1",
"simple-html-tokenizer": "^0.1.1"
},
Expand Down