@lucid-softworks/is-iterable
v0.1.0
Published
A structural type guard for synchronous iterables.
Maintainers
Readme
@lucid-softworks/is-iterable
Check for a callable Symbol.iterator method and narrow values to
Iterable<unknown>. Strings, arrays, sets, maps, generators, and custom
iterables are supported.
import { isIterable } from "@lucid-softworks/is-iterable";
if (isIterable(value)) {
[...value];
}