UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

7 lines (6 loc) 182 B
export function buildEnumParser(def, ...values) { return (str) => { const value = str.trim().toLowerCase(); return values.includes(value) ? value : def; }; }