Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

1 строка
2.1 KiB

  1. {"ast":null,"code":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = supportedProperty;\n\nvar _isInBrowser = require('is-in-browser');\n\nvar _isInBrowser2 = _interopRequireDefault(_isInBrowser);\n\nvar _prefix = require('./prefix');\n\nvar _prefix2 = _interopRequireDefault(_prefix);\n\nvar _camelize = require('./camelize');\n\nvar _camelize2 = _interopRequireDefault(_camelize);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nvar el = void 0;\nvar cache = {};\n\nif (_isInBrowser2['default']) {\n el = document.createElement('p');\n /**\n * We test every property on vendor prefix requirement.\n * Once tested, result is cached. It gives us up to 70% perf boost.\n * http://jsperf.com/element-style-object-access-vs-plain-object\n *\n * Prefill cache with known css properties to reduce amount of\n * properties we need to feature test at runtime.\n * http://davidwalsh.name/vendor-prefix\n */\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key in computed) {\n if (!isNaN(key)) cache[computed[key]] = computed[key];\n }\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop) {\n // For server-side rendering.\n if (!el) return prop; // We have not tested this prop yet, lets do the test.\n\n if (cache[prop] != null) return cache[prop]; // Camelization is required because we can't test using\n // css syntax for e.g. in FF.\n // Test if property is supported as it is.\n\n if ((0, _camelize2['default'])(prop) in el.style) {\n cache[prop] = prop;\n } // Test if property is supported with vendor prefix.\n else if (_prefix2['default'].js + (0, _camelize2['default'])('-' + prop) in el.style) {\n cache[prop] = _prefix2['default'].css + prop;\n } else {\n cache[prop] = false;\n }\n\n return cache[prop];\n}","map":null,"metadata":{},"sourceType":"script"}