069a029b3ee5d4876a11808abb161db4.json
3.21 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _unitlessNumbers=_interopRequireDefault(require(\"../../../modules/unitlessNumbers\"));function dangerousStyleValue(name,value,isCustomProperty){var isEmpty=value==null||typeof value==='boolean'||value==='';if(isEmpty){return'';}if(!isCustomProperty&&typeof value==='number'&&value!==0&&!(_unitlessNumbers.default.hasOwnProperty(name)&&_unitlessNumbers.default[name])){return value+'px';}return(''+value).trim();}var _default=dangerousStyleValue;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/vendor/react-dom/dangerousStyleValue/index.js"],"names":["dangerousStyleValue","name","value","isCustomProperty","isEmpty","isUnitlessNumber","hasOwnProperty","trim"],"mappings":"mKAWA,yFAWA,QAASA,CAAAA,mBAAT,CAA6BC,IAA7B,CAAmCC,KAAnC,CAA0CC,gBAA1C,CAA4D,CAU1D,GAAIC,CAAAA,OAAO,CAAGF,KAAK,EAAI,IAAT,EAAiB,MAAOA,CAAAA,KAAP,GAAiB,SAAlC,EAA+CA,KAAK,GAAK,EAAvE,CAEA,GAAIE,OAAJ,CAAa,CACX,MAAO,EAAP,CACD,CAED,GAAI,CAACD,gBAAD,EAAqB,MAAOD,CAAAA,KAAP,GAAiB,QAAtC,EAAkDA,KAAK,GAAK,CAA5D,EAAiE,EAAEG,yBAAiBC,cAAjB,CAAgCL,IAAhC,GAAyCI,yBAAiBJ,IAAjB,CAA3C,CAArE,CAAyI,CACvI,MAAOC,CAAAA,KAAK,CAAG,IAAf,CACD,CAED,MAAO,CAAC,GAAKA,KAAN,EAAaK,IAAb,EAAP,CACD,C,aAEcP,mB","sourcesContent":["/* eslint-disable */\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.0.0\n * \n */\nimport isUnitlessNumber from '../../../modules/unitlessNumbers';\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nexport default dangerousStyleValue;"]},"metadata":{},"sourceType":"script"}