Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).map(function (key) {
if (isPlainObject(obj[key])) return objToCss(obj[key], key);
return hyphenate(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
export function compileName(name: string): string {
return hyphenateStyleName(name);
}
function createMarkupForStyles(realm: Realm, styles: Value): Value {
let serialized = ([]: Array);
let delimiter = "";
if (styles instanceof ObjectValue && !styles.isPartialObject()) {
for (let [styleName, binding] of styles.properties) {
if (binding.descriptor !== undefined) {
let isCustomProperty = styleName.indexOf("--") === 0;
let styleValue = getProperty(realm, styles, styleName);
if (styleValue !== realm.intrinsics.null && styleValue !== realm.intrinsics.undefined) {
serialized.push(delimiter + hyphenateStyleName(styleName) + ":");
serialized.push(dangerousStyleValue(realm, styleName, styleValue, isCustomProperty));
delimiter = ";";
}
}
}
}
if (serialized.length > 0) {
return renderReactNode(realm, serialized);
}
return realm.intrinsics.null;
}
const processStyleName = memoizeStringOnly(function(styleName) {
return hyphenateStyleName(styleName);
});
(obj, key) => ({ [hyphenate(key)]: key, ...obj }),
{}
const css = Object.keys(obj).map(key => {
if (isPlainObject(obj[key])) return objToCss(obj[key], key)
return `${hyphenate(key)}: ${obj[key]};`
}).join(' ')
return prevKey ? `${prevKey} {
}).map(function (key) {
if (isPlainObject(obj[key])) return objToCss(obj[key], key);
return hyphenate(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
}).map(function (key) {
if (isPlainObject(obj[key])) return objToCss(obj[key], key);
return hyphenate(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;