@std-types/is-enum
v0.1.0
Published
Ensure a value is one of an enumerated set
Downloads
28
Readme
@std-types/is-enum
Ensure a value is one of an enumerated set
Installation
npm install @std-types/is-enum
Usage
import isEnum from "@std-types/is-enum";
enum E {
A,
B,
C,
}
console.log(isEnum(E.A, E)); // true
console.log(isEnum(E.B, E)); // true
console.log(isEnum(E.C, E)); // true
console.log(isEnum(true, E)); // false