Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-convert-values

Package Overview
Dependencies
Maintainers
7
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-convert-values - npm Package Compare versions

Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11

38

dist/index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc