MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / objToCss

Function objToCss

code/styling/public/app.js:19842–19851  ·  view source on GitHub ↗
(obj, prevKey)

Source from the content-addressed store, hash-verified

19840
19841//
19842var objToCss = function objToCss(obj, prevKey) {
19843 var css = Object.keys(obj).filter(function (key) {
19844 var chunk = obj[key];
19845 return chunk !== undefined && chunk !== null && chunk !== false && chunk !== '';
19846 }).map(function (key) {
19847 if (isPlainObject(obj[key])) return objToCss(obj[key], key);
19848 return hyphenateStyleName_1(key) + ': ' + obj[key] + ';';
19849 }).join(' ');
19850 return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
19851};
19852
19853var flatten = function flatten(chunks, executionContext) {
19854 return chunks.reduce(function (ruleSet, chunk) {

Callers 1

flattenFunction · 0.85

Calls 1

isPlainObjectFunction · 0.85

Tested by

no test coverage detected