fela-plugin-fallback-value
Advanced tools
Comparing version 4.0.1 to 4.1.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.FelaPluginFallbackValue = factory()); | ||
}(this, function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.FelaPluginFallbackValue = global.FelaPluginFallbackValue || {}))); | ||
}(this, function (exports) { 'use strict'; | ||
@@ -38,2 +38,17 @@ var babelHelpers = {}; | ||
babelHelpers.defineProperty = function (obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
}; | ||
babelHelpers.extends = Object.assign || function (target) { | ||
@@ -96,13 +111,13 @@ for (var i = 1; i < arguments.length; i++) { | ||
var hypenateStyleName = (index && typeof index === 'object' && 'default' in index ? index['default'] : index); | ||
var hyphenateStyleName = (index && typeof index === 'object' && 'default' in index ? index['default'] : index); | ||
function fallbackValue(style) { | ||
Object.keys(style).forEach(function (property) { | ||
function resolveFallbackValues(style) { | ||
for (var property in style) { | ||
var value = style[property]; | ||
if (Array.isArray(value)) { | ||
style[property] = value.join(';' + hypenateStyleName(property) + ':'); | ||
style[property] = value.join(';' + hyphenateStyleName(property) + ':'); | ||
} else if (value instanceof Object) { | ||
style[property] = fallbackValue(value); | ||
style[property] = resolveFallbackValues(value); | ||
} | ||
}); | ||
} | ||
@@ -112,9 +127,10 @@ return style; | ||
var fallbackValue$1 = (function () { | ||
return fallbackValue; | ||
var fallbackValue = (function () { | ||
return resolveFallbackValues; | ||
}); | ||
return fallbackValue$1; | ||
exports.resolveFallbackValues = resolveFallbackValues; | ||
exports['default'] = fallbackValue; | ||
})); | ||
//# sourceMappingURL=fela-plugin-fallback-value.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.FelaPluginFallbackValue=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e){return Object.keys(e).forEach(function(n){var o=e[n];Array.isArray(o)?e[n]=o.join(";"+r(n)+":"):o instanceof Object&&(e[n]=t(o))}),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 n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),n.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}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 o=e(function(e){function t(e){return e in r?r[e]:r[e]=e.replace(n,"-$&").toLowerCase().replace(o,"-ms-")}var n=/[A-Z]/g,o=/^ms-/,r={};e.exports=t}),r=o&&"object"==typeof o&&"default"in o?o.default:o,f=function(){return t};return f}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.FelaPluginFallbackValue=e.FelaPluginFallbackValue||{})}(this,function(e){"use strict";function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e){for(var t in e){var r=e[t];Array.isArray(r)?e[t]=r.join(";"+i(t)+":"):r instanceof Object&&(e[t]=n(r))}return e}var r={};r.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},r.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r.createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r.defineProperty=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},r.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.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)},r.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 o=t(function(e){function t(e){return e in o?o[e]:o[e]=e.replace(n,"-$&").toLowerCase().replace(r,"-ms-")}var n=/[A-Z]/g,r=/^ms-/,o={};e.exports=t}),i=o&&"object"==typeof o&&"default"in o?o.default:o,a=function(){return n};e.resolveFallbackValues=n,e.default=a}); |
{ | ||
"name": "fela-plugin-fallback-value", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "Fela plugin to resolve fallback values", | ||
@@ -22,4 +22,4 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"fela": "4.0.1" | ||
"fela": "4.1.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # fela-plugin-fallback-value | ||
<img alt="npm downloads" src="https://img.shields.io/npm/dm/fela-plugin-fallback-value.svg"> | ||
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-0.89kb-brightgreen.svg"> | ||
<img alt="gzipped size" src="https://img.shields.io/badge/gzipped-0.94kb-brightgreen.svg"> | ||
@@ -16,9 +16,9 @@ Sometimes you want to provide alternative values also know as *fallback values*. <br> | ||
``` | ||
Assuming you are using [npm](https://www.npmjs.com) as your package mananger you can just `npm install`.<br> | ||
Assuming you are using [npm](https://www.npmjs.com) as your package manager you can just `npm install`.<br> | ||
Otherwise we also provide a [UMD](https://github.com/umdjs/umd). You can easily use it via [unpkg](https://unpkg.com/). It registers a `FelaPluginFallbackValue` global. | ||
```HTML | ||
<!-- Fela (Development): Unminified version including all warnings --> | ||
<script src="https://unpkg.com/fela-plugin-fallback-value@4.0.1/dist/fela-plugin-fallback-value.js"></script> | ||
<script src="https://unpkg.com/fela-plugin-fallback-value@4.1.0/dist/fela-plugin-fallback-value.js"></script> | ||
<!-- Fela (Production): Minified version --> | ||
<script src="https://unpkg.com/fela-plugin-fallback-value@4.0.1/dist/fela-plugin-fallback-value.min.js"></script> | ||
<script src="https://unpkg.com/fela-plugin-fallback-value@4.1.0/dist/fela-plugin-fallback-value.min.js"></script> | ||
``` | ||
@@ -25,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
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
12125
107