MCPcopy
hub / github.com/lingodotdev/lingo.dev / createFlatLoader

Function createFlatLoader

packages/cli/src/cli/loaders/flat.ts:25–40  ·  view source on GitHub ↗
(options?: FlatLoaderOptions)

Source from the content-addressed store, hash-verified

23 * @param options.shouldPreserveObject - Predicate to identify objects that should not be flattened
24 */
25export default function createFlatLoader(options?: FlatLoaderOptions) {
26 const composedLoader = composeLoaders(
27 createDenormalizeLoader(options),
28 createNormalizeLoader(),
29 );
30
31 return {
32 ...composedLoader,
33 pullHints: async (input: Record<string, any>) => {
34 if (!input || typeof input !== "object") {
35 return {};
36 }
37 return flattenHints(input);
38 },
39 };
40}
41
42type DenormalizeResult = {
43 denormalized: Record<string, string>;

Callers 2

createBucketLoaderFunction · 0.85
flat.spec.tsFile · 0.85

Calls 4

composeLoadersFunction · 0.90
createDenormalizeLoaderFunction · 0.85
createNormalizeLoaderFunction · 0.85
flattenHintsFunction · 0.85

Tested by

no test coverage detected