You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 rivi
1.6 KiB

  1. {"ast":null,"code":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nexports['default'] = cloneStyle;\n\nvar _isObservable = require('./isObservable');\n\nvar _isObservable2 = _interopRequireDefault(_isObservable);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction cloneStyle(style) {\n // Support empty values in case user ends up with them by accident.\n if (style == null) return style; // Support string value for SimpleRule.\n\n var typeOfStyle = typeof style === 'undefined' ? 'undefined' : _typeof(style);\n\n if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {\n return style;\n } // Support array for FontFaceRule.\n\n\n if (isArray(style)) return style.map(cloneStyle); // Support Observable styles. Observables are immutable, so we don't need to\n // copy them.\n\n if ((0, _isObservable2['default'])(style)) return style;\n var newStyle = {};\n\n for (var name in style) {\n var value = style[name];\n\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n newStyle[name] = cloneStyle(value);\n continue;\n }\n\n newStyle[name] = value;\n }\n\n return newStyle;\n}","map":null,"metadata":{},"sourceType":"script"}