UNPKG

@observablehq/inspector

Version:

[![Node CI](https://github.com/observablehq/inspector/workflows/Node%20CI/badge.svg)](https://github.com/observablehq/inspector/actions?workflow=Node+CI)

19 lines (17 loc) 599 B
// TODO https://twitter.com/mbostock/status/702737065121742848 export function isarray(value) { return Array.isArray(value) || value instanceof Int8Array || value instanceof Int16Array || value instanceof Int32Array || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Uint16Array || value instanceof Uint32Array || value instanceof Float32Array || value instanceof Float64Array; } // Non-integer keys in arrays, e.g. [1, 2, 0.5: "value"]. export function isindex(key) { return key === (key | 0) + ""; }