postcss-convert-values
Advanced tools
Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11
@@ -8,4 +8,2 @@ "use strict"; | ||
var _postcss = _interopRequireDefault(require("postcss")); | ||
var _postcssValueParser = _interopRequireWildcard(require("postcss-value-parser")); | ||
@@ -15,2 +13,4 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } | ||
@@ -20,6 +20,17 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const LENGTH_UNITS = ['em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px']; | ||
/* | ||
* Numbers without digits after the dot are technically invalid, | ||
* but in that case css-value-parser returns the dot as part of the unit, | ||
* so we use this to remove the dot. | ||
*/ | ||
function stripLeadingDot(item) { | ||
if (item.charCodeAt(0) === '.'.charCodeAt(0)) { | ||
return item.slice(1); | ||
} else { | ||
return item; | ||
} | ||
} | ||
function parseWord(node, opts, keepZeroUnit) { | ||
@@ -30,3 +41,3 @@ const pair = (0, _postcssValueParser.unit)(node.value); | ||
const num = Number(pair.number); | ||
const u = pair.unit; | ||
const u = stripLeadingDot(pair.unit); | ||
@@ -105,9 +116,18 @@ if (num === 0) { | ||
var _default = _postcss.default.plugin(plugin, (opts = { | ||
function pluginCreator(opts = { | ||
precision: false | ||
}) => { | ||
return css => css.walkDecls(transform.bind(null, opts)); | ||
}); | ||
}) { | ||
return { | ||
postcssPlugin: plugin, | ||
OnceExit(css) { | ||
css.walkDecls(transform.bind(null, opts)); | ||
} | ||
}; | ||
} | ||
pluginCreator.postcss = true; | ||
var _default = pluginCreator; | ||
exports.default = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-convert-values", | ||
"version": "4.0.0-nightly.2020.1.9", | ||
"version": "4.0.0-nightly.2020.1.11", | ||
"description": "Convert values with PostCSS (e.g. ms -> s)", | ||
@@ -30,4 +30,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"postcss": "^7.0.16", | ||
"postcss-value-parser": "^3.3.1" | ||
"postcss-value-parser": "^4.1.0" | ||
}, | ||
@@ -39,3 +38,9 @@ "bugs": { | ||
"node": ">=10.13.0" | ||
}, | ||
"devDependencies": { | ||
"postcss": "^8.2.1" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.1" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10227
170
0
1
+ Addednanoid@3.3.7(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
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedpostcss-value-parser@3.3.1(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedpostcss-value-parser@^4.1.0