Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function ensureStringObj(object: types.NestedCSSProperties): { result: any, debugName: string } {
/** The final result we will return */
const result: types.CSSProperties & Dictionary = {};
let debugName = '';
for (const key in object) {
/** Grab the value upfront */
const val: any = (object as any)[key];
/** TypeStyle configuration options */
if (key === '$unique') {
result[FreeStyle.IS_UNIQUE] = val;
}
else if (key === '$nest') {
const nested = val!;
for (let selector in nested) {
const subproperties = nested[selector]!;
result[selector] = ensureStringObj(subproperties).result;
}
}
else if (key === '$debugName') {
debugName = val;
}
else {
result[key] = val
}
}