Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Bug: val is not iterable #55

@bertho-zero

Description

@bertho-zero

The following code cannot work with WeakMap and WeakSet which are not iterable.

const isNewIterable = (val) => {
const isMap = (Map && val instanceof Map);
const isSet = (Set && val instanceof Set);
const isWeakMap = (WeakMap && val instanceof WeakMap);
const isWeakSet = (WeakSet && val instanceof WeakSet);
return isMap || isSet || isWeakMap || isWeakSet;
};

} else if (isNewIterable(val)) {
return [...val];
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions