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

Function computeProcessableData

packages/cli/src/cli/cmd/run/_utils.ts:37–58  ·  view source on GitHub ↗
(
  sourceData: Record<string, any>,
  delta: Delta,
  force: boolean | undefined,
  onlyKeys: string[],
)

Source from the content-addressed store, hash-verified

35 * gets counted) so the two can never disagree on scope.
36 */
37export function computeProcessableData(
38 sourceData: Record<string, any>,
39 delta: Delta,
40 force: boolean | undefined,
41 onlyKeys: string[],
42): Record<string, any> {
43 return _.chain(sourceData)
44 .entries()
45 .filter(
46 ([key]) =>
47 delta.added.includes(key) || delta.updated.includes(key) || !!force,
48 )
49 .filter(
50 ([key]) =>
51 !onlyKeys.length ||
52 onlyKeys.some((pattern) =>
53 minimatch(safeDecode(key), safeDecode(pattern)),
54 ),
55 )
56 .fromPairs()
57 .value();
58}
59
60/**
61 * Determines the user's identity for tracking purposes.

Callers 3

estimateFunction · 0.90
estimate.spec.tsFile · 0.90
createWorkerTaskFunction · 0.90

Calls 1

safeDecodeFunction · 0.90

Tested by

no test coverage detected