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 line
3.0 KiB

{"ast":null,"code":"import isUnitlessNumber from \"../unitlessNumbers\";\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n if (isEmpty) {\n return '';\n }\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px';\n }\n return ('' + value).trim();\n}\nexport default dangerousStyleValue;","map":{"version":3,"names":["isUnitlessNumber","dangerousStyleValue","name","value","isCustomProperty","isEmpty","hasOwnProperty","trim"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/modules/setValueForStyles/dangerousStyleValue.js"],"sourcesContent":["/* eslint-disable */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and 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 '../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;"],"mappings":"AAWA,OAAOA,gBAAgB;AAWvB,SAASC,mBAAmB,CAACC,IAAI,EAAEC,KAAK,EAAEC,gBAAgB,EAAE;EAU1D,IAAIC,OAAO,GAAGF,KAAK,IAAI,IAAI,IAAI,OAAOA,KAAK,KAAK,SAAS,IAAIA,KAAK,KAAK,EAAE;EAEzE,IAAIE,OAAO,EAAE;IACX,OAAO,EAAE;EACX;EAEA,IAAI,CAACD,gBAAgB,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,CAAC,IAAI,EAAEH,gBAAgB,CAACM,cAAc,CAACJ,IAAI,CAAC,IAAIF,gBAAgB,CAACE,IAAI,CAAC,CAAC,EAAE;IACvI,OAAOC,KAAK,GAAG,IAAI;EACrB;EAEA,OAAO,CAAC,EAAE,GAAGA,KAAK,EAAEI,IAAI,EAAE;AAC5B;AAEA,eAAeN,mBAAmB"},"metadata":{},"sourceType":"module"}