MCPcopy Create free account
hub / github.com/chakra-ui/panda / makeArrayWithValueAt

Function makeArrayWithValueAt

packages/extractor/src/unbox.ts:20–29  ·  view source on GitHub ↗
(index: number, value: unknown)

Source from the content-addressed store, hash-verified

18}
19
20const makeArrayWithValueAt = (index: number, value: unknown) => {
21 if (index < 0) return []
22
23 const arr = [] as any[]
24 for (let i = 0; i <= index; i++) {
25 arr[i] = i === index ? value : undefined
26 }
27
28 return arr as unknown[]
29}
30
31const getLiteralValue = (node: BoxNode | undefined, ctx: UnboxContext): LiteralValue | undefined => {
32 if (!node) return

Callers 1

getLiteralValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected