REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.95 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/css-to-react-native/src/index.js
Text
Base64
/* eslint-disable no-param-reassign */ import parse from 'postcss-value-parser' import camelizeStyleName from 'camelize' import transforms from './transforms/index' import devPropertiesWithoutUnitsRegExp from './devPropertiesWithoutUnitsRegExp' import TokenStream from './TokenStream' // Note if this is wrong, you'll need to change tokenTypes.js too const numberOrLengthRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?:px)?$/i const numberOnlyRe = /^[+-]?(?:\d*\.\d*|[1-9]\d*)(?:e[+-]?\d+)?$/i const boolRe = /^true|false$/i const nullRe = /^null$/i const undefinedRe = /^undefined$/i // Undocumented export export const transformRawValue = (propName, value) => { if (process.env.NODE_ENV !== 'production') { const needsUnit = !devPropertiesWithoutUnitsRegExp.test(propName) const isNumberWithoutUnit = numberOnlyRe.test(value) if (needsUnit && isNumberWithoutUnit) { // eslint-disable-next-line no-console console.warn(`Expected style "${propName}: ${value}" to contain units`) } if (!needsUnit && value !== '0' && !isNumberWithoutUnit) { // eslint-disable-next-line no-console console.warn(`Expected style "${propName}: ${value}" to be unitless`) } } const numberMatch = value.match(numberOrLengthRe) if (numberMatch !== null) return Number(numberMatch[1]) const boolMatch = value.match(boolRe) if (boolMatch !== null) return boolMatch[0].toLowerCase() === 'true' const nullMatch = value.match(nullRe) if (nullMatch !== null) return null const undefinedMatch = value.match(undefinedRe) if (undefinedMatch !== null) return undefined return value } const baseTransformShorthandValue = (propName, value) => { const ast = parse(value) const tokenStream = new TokenStream(ast.nodes) return transforms[propName](tokenStream) } const transformShorthandValue = process.env.NODE_ENV === 'production' ? baseTransformShorthandValue : (propName, value) => { try { return baseTransformShorthandValue(propName, value) } catch (e) { throw new Error(`Failed to parse declaration "${propName}: ${value}"`) } } export const getStylesForProperty = (propName, inputValue, allowShorthand) => { const isRawValue = allowShorthand === false || !(propName in transforms) const value = inputValue.trim() const propValues = isRawValue ? { [propName]: transformRawValue(propName, value) } : transformShorthandValue(propName, value) return propValues } export const getPropertyName = propName => { const isCustomProp = /^--\w+/.test(propName) if (isCustomProp) { return propName } return camelizeStyleName(propName) } export default (rules, shorthandBlacklist = []) => rules.reduce((accum, rule) => { const propertyName = getPropertyName(rule[0]) const value = rule[1] const allowShorthand = shorthandBlacklist.indexOf(propertyName) === -1 return Object.assign( accum, getStylesForProperty(propertyName, value, allowShorthand) ) }, {})
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
transforms
DIR
-
drwxr-xr-x
2026-02-28 00:29:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__tests__
DIR
-
drwxr-xr-x
2026-02-28 00:28:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
devPropertiesWithoutUnitsRegExp.js
405 B
lrw-r--r--
2026-02-28 00:28:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
2.95 KB
lrw-r--r--
2026-02-28 00:28:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TokenStream.js
1.65 KB
lrw-r--r--
2026-02-28 00:28:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tokenTypes.js
2.54 KB
lrw-r--r--
2026-02-28 00:28:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).