MCPcopy
hub / github.com/tailwindlabs/tailwindcss / permute

Function permute

packages/tailwindcss/src/variants.test.ts:2758–2767  ·  view source on GitHub ↗
(arr: string[])

Source from the content-addressed store, hash-verified

2756
2757test('variants with the same root are sorted deterministically', async () => {
2758 function permute(arr: string[]): string[][] {
2759 if (arr.length <= 1) return [arr]
2760
2761 return arr.flatMap((item, i) =>
2762 permute([...arr.slice(0, i), ...arr.slice(i + 1)]).map((permutation) => [
2763 item,
2764 ...permutation,
2765 ]),
2766 )
2767 }
2768
2769 let classLists = permute([
2770 'data-hover:flex',

Callers 1

variants.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected