MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / isValidArrayIndex

Function isValidArrayIndex

packages/core/src/document/prop/prop.ts:735–738  ·  view source on GitHub ↗
(key: any, limit = -1)

Source from the content-addressed store, hash-verified

733 * check if the key is a valid array index
734 */
735export function isValidArrayIndex(key: any, limit = -1): key is number {
736 const n = Number.parseFloat(String(key))
737 return n >= 0 && Math.floor(n) === n && Number.isFinite(n) && (limit < 0 || n < limit)
738}

Callers 2

getMethod · 0.85
setMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected