postcss-normalize-url
Advanced tools
Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11
@@ -10,4 +10,2 @@ "use strict"; | ||
var _postcss = _interopRequireDefault(require("postcss")); | ||
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser")); | ||
@@ -60,9 +58,14 @@ | ||
decl.value = (0, _postcssValueParser.default)(decl.value).walk(node => { | ||
if (node.type !== 'function' || node.value.toLowerCase() !== 'url' || !node.nodes.length) { | ||
if (node.type !== 'function' || node.value.toLowerCase() !== 'url') { | ||
return false; | ||
} | ||
node.before = node.after = ''; | ||
if (!node.nodes.length) { | ||
return false; | ||
} | ||
let url = node.nodes[0]; | ||
let escaped; | ||
node.before = node.after = ''; | ||
url.value = url.value.trim().replace(multiline, ''); // Skip empty URLs | ||
@@ -99,20 +102,27 @@ // Empty URL function equals request to current stylesheet where it is declared | ||
var _default = _postcss.default.plugin('postcss-normalize-url', opts => { | ||
function pluginCreator(opts) { | ||
opts = Object.assign({}, { | ||
normalizeProtocol: false, | ||
stripFragment: false, | ||
stripHash: false, | ||
stripWWW: false | ||
}, opts); | ||
return css => { | ||
css.walk(node => { | ||
if (node.type === 'decl') { | ||
return transformDecl(node, opts); | ||
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') { | ||
return transformNamespace(node); | ||
} | ||
}); | ||
return { | ||
postcssPlugin: 'postcss-normalize-url', | ||
OnceExit(css) { | ||
css.walk(node => { | ||
if (node.type === 'decl') { | ||
return transformDecl(node, opts); | ||
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') { | ||
return transformNamespace(node); | ||
} | ||
}); | ||
} | ||
}; | ||
}); | ||
} | ||
pluginCreator.postcss = true; | ||
var _default = pluginCreator; | ||
exports.default = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-normalize-url", | ||
"version": "4.0.0-nightly.2020.1.9", | ||
"version": "4.0.0-nightly.2020.1.11", | ||
"description": "Normalize URLs with PostCSS", | ||
@@ -26,6 +26,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"is-absolute-url": "^2.1.0", | ||
"normalize-url": "^3.3.0", | ||
"postcss": "^7.0.16", | ||
"postcss-value-parser": "^3.3.1" | ||
"is-absolute-url": "^3.0.3", | ||
"normalize-url": "^4.5.0", | ||
"postcss-value-parser": "^4.1.0" | ||
}, | ||
@@ -44,3 +43,9 @@ "homepage": "https://github.com/cssnano/cssnano", | ||
"node": ">=10.13.0" | ||
}, | ||
"devDependencies": { | ||
"postcss": "^8.2.1" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.1" | ||
} | ||
} |
@@ -44,3 +44,3 @@ # [postcss][postcss]-normalize-url | ||
Please see the [normalize-url documentation][docs]. By default, | ||
`normalizeProtocol`, `stripFragment` & `stripWWW` are set to `false`. | ||
`normalizeProtocol`, `stripHash` & `stripWWW` are set to `false`. | ||
@@ -47,0 +47,0 @@ ## Contributors |
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
6518
94
1
+ Addedis-absolute-url@3.0.3(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addednormalize-url@4.5.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removedpostcss@^7.0.16
- Removedis-absolute-url@2.1.0(transitive)
- Removednormalize-url@3.3.0(transitive)
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedpostcss-value-parser@3.3.1(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedis-absolute-url@^3.0.3
Updatednormalize-url@^4.5.0
Updatedpostcss-value-parser@^4.1.0