Skip to content

Support spread and array for B's logical gates #128

@apademide

Description

@apademide

B.any, B.some, B.notAll, etc. should both support fn(["false", true, "true"]) (current) and fn("false", true, "true") (new).

The simplest option is to fn(...args) → args.flat(), however this could potentially cause unexpected behaviours if the function is called with arrays as arguments (fn(true, [false]) would flatten into (true, false) where !![false] !== !!false. Thus, we could check if the arguments's length is 1, like (args.length === 1 && isArray(args[0]) ? args[0] : args).some(toBoolean).

Metadata

Metadata

Assignees

Labels

🚀 — ImprovementEnhancement, feature request or suggestion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions