postcss-normalize-url
Advanced tools
Comparing version 5.0.3 to 5.0.4
@@ -14,4 +14,2 @@ "use strict"; | ||
var _isAbsoluteUrl = _interopRequireDefault(require("is-absolute-url")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -21,6 +19,24 @@ | ||
const escapeChars = /([\s\(\)"'])/g; | ||
const escapeChars = /([\s\(\)"'])/g; // Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 | ||
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 | ||
const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/; // Windows paths like `c:\` | ||
const WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/; | ||
/** | ||
* Originally in sindresorhus/is-absolute-url | ||
* | ||
* @param {string} url | ||
*/ | ||
function isAbsolute(url) { | ||
if (WINDOWS_PATH_REGEX.test(url)) { | ||
return false; | ||
} | ||
return ABSOLUTE_URL_REGEX.test(url); | ||
} | ||
function convert(url, options) { | ||
if ((0, _isAbsoluteUrl.default)(url) || url.startsWith('//')) { | ||
if (isAbsolute(url) || url.startsWith('//')) { | ||
let normalizedURL = null; | ||
@@ -27,0 +43,0 @@ |
{ | ||
"name": "postcss-normalize-url", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"description": "Normalize URLs with PostCSS", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"prebuild": "rimraf dist", | ||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepare": "yarn build" | ||
@@ -27,5 +27,4 @@ }, | ||
"dependencies": { | ||
"is-absolute-url": "^3.0.3", | ||
"normalize-url": "^6.0.1", | ||
"postcss-value-parser": "^4.1.0" | ||
"postcss-value-parser": "^4.2.0" | ||
}, | ||
@@ -32,0 +31,0 @@ "homepage": "https://github.com/cssnano/cssnano", |
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
6908
3
109
- Removedis-absolute-url@^3.0.3
- Removedis-absolute-url@3.0.3(transitive)
Updatedpostcss-value-parser@^4.2.0