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

fela-plugin-unit

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-unit - npm Package Compare versions

Comparing version 3.0.8 to 4.0.0

361

dist/fela-plugin-unit.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.FelaPluginUnit = factory());
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.FelaPluginUnit = factory());
}(this, function () { 'use strict';
var babelHelpers = {};
babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var babelHelpers = {};
babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
babelHelpers.classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
babelHelpers.classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
babelHelpers.createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
babelHelpers.createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
babelHelpers.extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
babelHelpers.extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return target;
};
babelHelpers.inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
babelHelpers.inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
babelHelpers.possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
babelHelpers.possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
babelHelpers;
babelHelpers;
function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; }
function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; }
/* weak */
var warning = function warning() {
return true;
};
var warning = function warning() {
return true;
if (true) {
warning = function warning(condition, message) {
if (!condition) {
if (typeof console !== 'undefined') {
console.error(message); // eslint-disable-line
}
}
};
}
if (true) {
warning = function warning(condition, message) {
if (!condition) {
if (typeof console !== 'undefined') {
console.error(message); // eslint-disable-line
}
throw new Error(message);
}
};
}
var warning$1 = warning;
var warning$1 = warning;
var index$1 = __commonjs(function (module) {
'use strict';
var index$1 = __commonjs(function (module) {
'use strict';
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
var cache = {};
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
function hyphenateStyleName(string) {
return string in cache ? cache[string] : cache[string] = string.replace(uppercasePattern, '-$&').toLowerCase().replace(msPattern, '-ms-');
}
function hyphenateStyleName(string) {
return string.replace(uppercasePattern, '-$&').toLowerCase().replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
});
module.exports = hyphenateStyleName;
});
var require$$0 = (index$1 && typeof index$1 === 'object' && 'default' in index$1 ? index$1['default'] : index$1);
var require$$0 = (index$1 && typeof index$1 === 'object' && 'default' in index$1 ? index$1['default'] : index$1);
var index = __commonjs(function (module) {
var hyphenateStyleName = require$$0;
var index = __commonjs(function (module) {
var hyphenateStyleName = require$$0;
var unitlessProperties = {
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
fontWeight: true,
lineHeight: true,
opacity: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
var unitlessProperties = {
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
fontWeight: true,
lineHeight: true,
opacity: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
var prefixedUnitlessProperties = {
animationIterationCount: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridColumn: true,
order: true,
lineClamp: true
};
var prefixedUnitlessProperties = {
animationIterationCount: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridColumn: true,
order: true,
lineClamp: true
};
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
function getPrefixedKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.slice(1);
}
function getPrefixedKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.slice(1);
}
// add all prefixed properties to the unitless properties
Object.keys(prefixedUnitlessProperties).forEach(function (property) {
unitlessProperties[property] = true;
// add all prefixed properties to the unitless properties
Object.keys(prefixedUnitlessProperties).forEach(function (property) {
unitlessProperties[property] = true;
prefixes.forEach(function (prefix) {
unitlessProperties[getPrefixedKey(prefix, property)] = true;
});
prefixes.forEach(function (prefix) {
unitlessProperties[getPrefixedKey(prefix, property)] = true;
});
});
// add all hypenated properties as well
Object.keys(unitlessProperties).forEach(function (property) {
unitlessProperties[hyphenateStyleName(property)] = true;
});
// add all hypenated properties as well
Object.keys(unitlessProperties).forEach(function (property) {
unitlessProperties[hyphenateStyleName(property)] = true;
});
module.exports = function (property) {
return unitlessProperties[property];
};
});
module.exports = function (property) {
return unitlessProperties[property];
};
});
var isUnitlessCSSProperty = (index && typeof index === 'object' && 'default' in index ? index['default'] : index);
var isUnitlessCSSProperty = (index && typeof index === 'object' && 'default' in index ? index['default'] : index);
function addUnitIfNeeded(property, value, unit) {
var valueType = typeof value === 'undefined' ? 'undefined' : babelHelpers.typeof(value);
if (valueType === 'number' || valueType === 'string' && value == parseFloat(value)) {
// eslint-disable-line
value += unit;
}
return value;
function addUnitIfNeeded(property, value, unit) {
var valueType = typeof value === 'undefined' ? 'undefined' : babelHelpers.typeof(value);
if (valueType === 'number' || valueType === 'string' && value == parseFloat(value)) {
// eslint-disable-line
value += unit;
}
function addUnit(style, unit, propertyMap) {
Object.keys(style).forEach(function (property) {
if (!isUnitlessCSSProperty(property)) {
(function () {
return value;
}
var value = style[property];
var propertyUnit = propertyMap[property] || unit;
if (Array.isArray(value)) {
style[property] = value.map(function (value) {
return addUnitIfNeeded(property, value, propertyUnit);
});
} else if (value instanceof Object) {
style[property] = addUnit(value, unit, propertyMap);
} else {
style[property] = addUnitIfNeeded(property, value, propertyUnit);
}
})();
}
});
function addUnit(style, unit, propertyMap) {
Object.keys(style).forEach(function (property) {
if (!isUnitlessCSSProperty(property)) {
(function () {
return style;
}
var value = style[property];
var propertyUnit = propertyMap[property] || unit;
if (Array.isArray(value)) {
style[property] = value.map(function (value) {
return addUnitIfNeeded(property, value, propertyUnit);
});
} else if (value instanceof Object) {
style[property] = addUnit(value, unit, propertyMap);
} else {
style[property] = addUnitIfNeeded(property, value, propertyUnit);
}
})();
}
});
var unit = (function () {
var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'px';
var propertyMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return style;
}
warning$1(unit.match(/ch|em|ex|rem|vh|vw|vmin|vmax|px|cm|mm|in|pc|pt|mozmm|%/) !== null, 'You are using an invalid unit `' + unit + '`. Consider using one of the following ch, em, ex, rem, vh, vw, vmin, vmax, px, cm, mm, in, pc, pt, mozmm or %.');
var unit = (function () {
var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'px';
var propertyMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (style) {
return addUnit(style, unit, propertyMap);
};
});
warning$1(unit.match(/ch|em|ex|rem|vh|vw|vmin|vmax|px|cm|mm|in|pc|pt|mozmm|%/) !== null, 'You are using an invalid unit `' + unit + '`. Consider using one of the following ch, em, ex, rem, vh, vw, vmin, vmax, px, cm, mm, in, pc, pt, mozmm or %.');
return unit;
return function (style) {
return addUnit(style, unit, propertyMap);
};
});
return unit;
}));
//# sourceMappingURL=fela-plugin-unit.js.map

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FelaPluginUnit=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e,t,o){var r="undefined"==typeof t?"undefined":n.typeof(t);return("number"===r||"string"===r&&t==parseFloat(t))&&(t+=o),t}function o(e,n,r){return Object.keys(e).forEach(function(i){u(i)||!function(){var f=e[i],u=r[i]||n;Array.isArray(f)?e[i]=f.map(function(e){return t(i,e,u)}):f instanceof Object?e[i]=o(f,n,r):e[i]=t(i,f,u)}()}),e}var n={};n.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n.createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),n.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},n.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},n.possibleConstructorReturn=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};var r=e(function(e){function t(e){return e.replace(o,"-$&").toLowerCase().replace(n,"-ms-")}var o=/[A-Z]/g,n=/^ms-/;e.exports=t}),i=r&&"object"==typeof r&&"default"in r?r.default:r,f=e(function(e){function t(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}var o=i,n={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},r={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,order:!0,lineClamp:!0},f=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){n[e]=!0,f.forEach(function(o){n[t(o,e)]=!0})}),Object.keys(n).forEach(function(e){n[o(e)]=!0}),e.exports=function(e){return n[e]}}),u=f&&"object"==typeof f&&"default"in f?f.default:f,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"px",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){return o(n,e,t)}};return a});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FelaPluginUnit=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e,t,o){var r="undefined"==typeof t?"undefined":n.typeof(t);return("number"===r||"string"===r&&t==parseFloat(t))&&(t+=o),t}function o(e,n,r){return Object.keys(e).forEach(function(i){u(i)||!function(){var f=e[i],u=r[i]||n;Array.isArray(f)?e[i]=f.map(function(e){return t(i,e,u)}):f instanceof Object?e[i]=o(f,n,r):e[i]=t(i,f,u)}()}),e}var n={};n.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n.createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),n.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},n.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},n.possibleConstructorReturn=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};var r=e(function(e){function t(e){return e in r?r[e]:r[e]=e.replace(o,"-$&").toLowerCase().replace(n,"-ms-")}var o=/[A-Z]/g,n=/^ms-/,r={};e.exports=t}),i=r&&"object"==typeof r&&"default"in r?r.default:r,f=e(function(e){function t(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}var o=i,n={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},r={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,order:!0,lineClamp:!0},f=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){n[e]=!0,f.forEach(function(o){n[t(o,e)]=!0})}),Object.keys(n).forEach(function(e){n[o(e)]=!0}),e.exports=function(e){return n[e]}}),u=f&&"object"==typeof f&&"default"in f?f.default:f,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"px",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){return o(n,e,t)}};return a});
{
"name": "fela-plugin-unit",
"version": "3.0.8",
"version": "4.0.0",
"description": "Fela plugin to automatically add units if required",

@@ -24,4 +24,4 @@ "main": "index.js",

"peerDependencies": {
"fela": "3.0.8"
"fela": "4.0.0"
}
}

@@ -5,3 +5,3 @@ # fela-plugin-unit

<img alt="npm downloads" src="https://img.shields.io/npm/dm/fela-plugin-unit.svg">
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-1.34kb-brightgreen.svg">
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-1.35kb-brightgreen.svg">

@@ -19,5 +19,5 @@ Always writing length values as string with a value applied seems not like the JavaScript way to do it. You can also use mathematics to process number values. <br>

<!-- Fela (Development): Unminified version including all warnings -->
<script src="https://unpkg.com/fela-plugin-unit@3.0.8/dist/fela-plugin-unit.js"></script>
<script src="https://unpkg.com/fela-plugin-unit@4.0.0/dist/fela-plugin-unit.js"></script>
<!-- Fela (Production): Minified version -->
<script src="https://unpkg.com/fela-plugin-unit@3.0.8/dist/fela-plugin-unit.min.js"></script>
<script src="https://unpkg.com/fela-plugin-unit@4.0.0/dist/fela-plugin-unit.min.js"></script>
```

@@ -24,0 +24,0 @@

Sorry, the diff of this file is not supported yet

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