@fower/css-object-processor
Advanced tools
Comparing version 1.86.0 to 2.0.0
@@ -30,30 +30,31 @@ 'use strict'; | ||
var _loop = function _loop() { | ||
var key = _keys[_i]; | ||
var value = cssObj[key]; | ||
if (typeof value !== 'object') { | ||
var _ref, _ref2; | ||
var next = prefix ? [prefix, (_ref = {}, _ref[key] = value, _ref)] : [(_ref2 = {}, _ref2[key] = value, _ref2)]; | ||
result.push(next); | ||
return "continue"; | ||
} | ||
if (Array.isArray(value)) { | ||
var _ref3; | ||
if (breakpoints) { | ||
var pointKeys = Object.keys(breakpoints); | ||
var obj = value.reduce(function (result, cur, i) { | ||
var _extends2; | ||
var prop = "" + key + (i === 0 ? '' : '--' + pointKeys[i - 1]); | ||
return _extends({}, result, (_extends2 = {}, _extends2[prop] = cur, _extends2)); | ||
}, {}); | ||
result = [].concat(result, flatten(obj, breakpoints, prefix)); | ||
return "continue"; | ||
var key = _keys[_i]; | ||
var value = cssObj[key]; | ||
if (typeof value !== 'object') { | ||
var _ref, _ref2; | ||
var next = prefix ? [prefix, (_ref = {}, _ref[key] = value, _ref)] : [(_ref2 = {}, _ref2[key] = value, _ref2)]; | ||
result.push(next); | ||
return 0; // continue | ||
} | ||
result.push([(_ref3 = {}, _ref3[key] = value, _ref3)]); | ||
return "continue"; | ||
} | ||
result = [].concat(result, flatten(value, breakpoints, key)); | ||
}; | ||
if (Array.isArray(value)) { | ||
var _ref3; | ||
if (breakpoints) { | ||
var pointKeys = Object.keys(breakpoints); | ||
var obj = value.reduce(function (result, cur, i) { | ||
var _extends2; | ||
var prop = "" + key + (i === 0 ? '' : '--' + pointKeys[i - 1]); | ||
return _extends({}, result, (_extends2 = {}, _extends2[prop] = cur, _extends2)); | ||
}, {}); | ||
result = [].concat(result, flatten(obj, breakpoints, prefix)); | ||
return 0; // continue | ||
} | ||
result.push([(_ref3 = {}, _ref3[key] = value, _ref3)]); | ||
return 0; // continue | ||
} | ||
result = [].concat(result, flatten(value, breakpoints, key)); | ||
}, | ||
_ret; | ||
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) { | ||
var _ret = _loop(); | ||
if (_ret === "continue") continue; | ||
_ret = _loop(); | ||
if (_ret === 0) continue; | ||
} | ||
@@ -60,0 +61,0 @@ return result; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@fower/utils");function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e){return/^::?.+/.test(e)}function n(e,t,o){for(var u=[],c=Object.keys(e),s=function(){var c=a[i],s=e[c];if("object"!=typeof s){var f,l,p=o?[o,(f={},f[c]=s,f)]:[(l={},l[c]=s,l)];return u.push(p),"continue"}if(Array.isArray(s)){var v;if(t){var y=Object.keys(t),d=s.reduce((function(e,t,n){var o;return r({},e,((o={})[c+(0===n?"":"--"+y[n-1])]=t,o))}),{});return u=[].concat(u,n(d,t,o)),"continue"}return u.push([(v={},v[c]=s,v)]),"continue"}u=[].concat(u,n(s,t,c))},i=0,a=c;i<a.length;i++)s();return u}function o(e,r){return n(e,r,null).reduce((function(e,r){var n=r.pop(),o=r.reduce((function(e,r){return t(r)?""+e+r:e+" "+r}),"").trim(),u="child";return t(o)&&(u="pseudo"),""===o&&(u="void"),o.startsWith("&")&&(u="sibling",o=o.replace(/^&/,"")),[].concat(e,[{selector:o,style:n,selectorType:u}])}),[])}exports.flatten=n,exports.parse=o,exports.toRules=function(r,t){var n=t?"."+t:"";return o(r).map((function(r){return function(r,t){void 0===t&&(t="");var n=r.selector,o=r.selectorType,u=r.style,c=function(r){for(var t="",n=0,o=Object.entries(r);n<o.length;n++){var u=o[n],c=u[1];t+=e.jsKeyToCssKey(u[0])+": "+c}return t}(u);return"void"===o?"."+(e.objectToClassName(u)||t)+" {"+c+"}":t+("pseudo"===o?"":" ")+n+" {"+c+"}"}(r,n)}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@fower/utils");function e(){return(e=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}).apply(this,arguments)}function t(r){return/^::?.+/.test(r)}function n(r,t,o){for(var u=[],c=Object.keys(r),s=function(){var c=a[i],s=r[c];if("object"!=typeof s){var f,l,p=o?[o,(f={},f[c]=s,f)]:[(l={},l[c]=s,l)];return u.push(p),0}if(Array.isArray(s)){var v;if(t){var y=Object.keys(t),d=s.reduce((function(r,t,n){var o;return e({},r,((o={})[c+(0===n?"":"--"+y[n-1])]=t,o))}),{});return u=[].concat(u,n(d,t,o)),0}return u.push([(v={},v[c]=s,v)]),0}u=[].concat(u,n(s,t,c))},i=0,a=c;i<a.length;i++)s();return u}function o(r,e){return n(r,e,null).reduce((function(r,e){var n=e.pop(),o=e.reduce((function(r,e){return t(e)?""+r+e:r+" "+e}),"").trim(),u="child";return t(o)&&(u="pseudo"),""===o&&(u="void"),o.startsWith("&")&&(u="sibling",o=o.replace(/^&/,"")),[].concat(r,[{selector:o,style:n,selectorType:u}])}),[])}exports.flatten=n,exports.parse=o,exports.toRules=function(e,t){var n=t?"."+t:"";return o(e).map((function(e){return function(e,t){void 0===t&&(t="");var n=e.selector,o=e.selectorType,u=e.style,c=function(e){for(var t="",n=0,o=Object.entries(e);n<o.length;n++){var u=o[n],c=u[1];t+=r.jsKeyToCssKey(u[0])+": "+c}return t}(u);return"void"===o?"."+(r.objectToClassName(u)||t)+" {"+c+"}":t+("pseudo"===o?"":" ")+n+" {"+c+"}"}(e,n)}))}; | ||
//# sourceMappingURL=css-object-processor.cjs.production.min.js.map |
@@ -26,30 +26,31 @@ import { objectToClassName, jsKeyToCssKey } from '@fower/utils'; | ||
var _loop = function _loop() { | ||
var key = _keys[_i]; | ||
var value = cssObj[key]; | ||
if (typeof value !== 'object') { | ||
var _ref, _ref2; | ||
var next = prefix ? [prefix, (_ref = {}, _ref[key] = value, _ref)] : [(_ref2 = {}, _ref2[key] = value, _ref2)]; | ||
result.push(next); | ||
return "continue"; | ||
} | ||
if (Array.isArray(value)) { | ||
var _ref3; | ||
if (breakpoints) { | ||
var pointKeys = Object.keys(breakpoints); | ||
var obj = value.reduce(function (result, cur, i) { | ||
var _extends2; | ||
var prop = "" + key + (i === 0 ? '' : '--' + pointKeys[i - 1]); | ||
return _extends({}, result, (_extends2 = {}, _extends2[prop] = cur, _extends2)); | ||
}, {}); | ||
result = [].concat(result, flatten(obj, breakpoints, prefix)); | ||
return "continue"; | ||
var key = _keys[_i]; | ||
var value = cssObj[key]; | ||
if (typeof value !== 'object') { | ||
var _ref, _ref2; | ||
var next = prefix ? [prefix, (_ref = {}, _ref[key] = value, _ref)] : [(_ref2 = {}, _ref2[key] = value, _ref2)]; | ||
result.push(next); | ||
return 0; // continue | ||
} | ||
result.push([(_ref3 = {}, _ref3[key] = value, _ref3)]); | ||
return "continue"; | ||
} | ||
result = [].concat(result, flatten(value, breakpoints, key)); | ||
}; | ||
if (Array.isArray(value)) { | ||
var _ref3; | ||
if (breakpoints) { | ||
var pointKeys = Object.keys(breakpoints); | ||
var obj = value.reduce(function (result, cur, i) { | ||
var _extends2; | ||
var prop = "" + key + (i === 0 ? '' : '--' + pointKeys[i - 1]); | ||
return _extends({}, result, (_extends2 = {}, _extends2[prop] = cur, _extends2)); | ||
}, {}); | ||
result = [].concat(result, flatten(obj, breakpoints, prefix)); | ||
return 0; // continue | ||
} | ||
result.push([(_ref3 = {}, _ref3[key] = value, _ref3)]); | ||
return 0; // continue | ||
} | ||
result = [].concat(result, flatten(value, breakpoints, key)); | ||
}, | ||
_ret; | ||
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) { | ||
var _ret = _loop(); | ||
if (_ret === "continue") continue; | ||
_ret = _loop(); | ||
if (_ret === 0) continue; | ||
} | ||
@@ -56,0 +57,0 @@ return result; |
{ | ||
"name": "@fower/css-object-processor", | ||
"version": "1.86.0", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
@@ -17,3 +17,3 @@ "main": "dist/index.js", | ||
"csstype": "^3.1.2", | ||
"@fower/utils": "1.86.0" | ||
"@fower/utils": "2.0.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
34818
299
+ Added@fower/utils@2.0.0(transitive)
- Removed@fower/utils@1.86.0(transitive)
Updated@fower/utils@2.0.0