MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / buildDenormalizedKeysMap

Function buildDenormalizedKeysMap

packages/cli/src/cli/loaders/flat.ts:116–129  ·  view source on GitHub ↗
(obj: Record<string, string>)

Source from the content-addressed store, hash-verified

114}
115
116export function buildDenormalizedKeysMap(obj: Record<string, string>) {
117 if (!obj) return {};
118
119 return Object.keys(obj).reduce(
120 (acc, key) => {
121 if (key) {
122 const normalizedKey = `${key}`.replace(OBJECT_NUMERIC_KEY_PREFIX, "");
123 acc[normalizedKey] = key;
124 }
125 return acc;
126 },
127 {} as Record<string, string>,
128 );
129}
130
131export function mapDenormalizedKeys(
132 obj: Record<string, any>,

Callers 2

flat.spec.tsFile · 0.90
createDenormalizeLoaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected