MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / toNumberArray

Function toNumberArray

lib/state/utils.ts:174–183  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

172 }
173
174 const toNumberArray = (value: unknown): number[] =>
175 Array.isArray(value)
176 ? [
177 ...new Set(
178 value.filter(
179 (item): item is number => Number.isInteger(item) && item > 0,
180 ),
181 ),
182 ]
183 : []
184 const toStringArray = (value: unknown): string[] =>
185 Array.isArray(value)
186 ? [...new Set(value.filter((item): item is string => typeof item === "string"))]

Callers 1

loadPruneMessagesStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected