MCPcopy
hub / github.com/Khan/aphrodite / create

Function create

src/exports.js:41–58  ·  view source on GitHub ↗
(sheetDefinition /* : SheetDefinition */)

Source from the content-addressed store, hash-verified

39
40const StyleSheet = {
41 create(sheetDefinition /* : SheetDefinition */) /* : Object */ {
42 const mappedSheetDefinition = {};
43 const keys = Object.keys(sheetDefinition);
44
45 for (let i = 0; i < keys.length; i += 1) {
46 const key = keys[i];
47 const val = sheetDefinition[key];
48 const stringVal = JSON.stringify(val);
49
50 mappedSheetDefinition[key] = {
51 _len: stringVal.length,
52 _name: hashFn(stringVal, key),
53 _definition: val,
54 };
55 }
56
57 return mappedSheetDefinition;
58 },
59
60 rehydrate(renderedClassNames /* : string[] */ =[]) {
61 addRenderedClassNames(renderedClassNames);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected