MCPcopy
hub / github.com/vercel/next.js / getCombinations

Function getCombinations

test/integration/create-next-app/templates/matrix.test.ts:47–54  ·  view source on GitHub ↗
(items: string[][])

Source from the content-addressed store, hash-verified

45 }
46
47 const getCombinations = (items: string[][]): string[][] => {
48 if (!items.length) return [[]]
49 const [first, ...rest] = items
50 const children = getCombinations(rest)
51 return first.flatMap((value) =>
52 children.map((child) => [...value.split(' '), ...child])
53 )
54 }
55
56 const flagCombinations = getCombinations(Object.values(allFlagValues))
57 const testCases = flagCombinations.map((flags) => ({

Callers 2

applyMethod · 0.85
matrix.test.tsFile · 0.85

Calls 2

splitMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected