MCPcopy Index your code
hub / github.com/darkreader/darkreader / isArrayLike

Function isArrayLike

src/utils/array.ts:1–3  ·  view source on GitHub ↗
(items: Iterable<T> | ArrayLike<T>)

Source from the content-addressed store, hash-verified

1function isArrayLike<T>(items: Iterable<T> | ArrayLike<T>): items is ArrayLike<T> {
2 return (items as ArrayLike<T>).length != null;
3}
4
5// NOTE: Iterating Array-like items using `for .. of` is 3x slower in Firefox
6// https://jsben.ch/kidOp

Callers 1

forEachFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected