Skip to content

Feature request: isIn (array) or isOneOf #10

@photonite

Description

@photonite

A useful method to check if an expression exists in an array, example:

const fruits = ['apple', 'orange']
const vegetables = ['eggplant', 'carrot']
const food = 'apple'

const foodCatrgory = match(food)
   .isOneOf(fruits).then('fruit')
   .isOneOf(vegetables).then('vegetable')
   .else('not food')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions