num-match
Verbal number classifier
npm i num-match
const numMatch = ;// orconst numMatch from 'num-match';
Create array of verbal rules:
const rules = '&2=baby' // till 2 '3&8=child' // from 3 to 8 '9&18=teenager' '19&26!=student' // from 19 to 26 (26 not include) // use ! to not to "include" '26&=grownup' // from 26;
Create your func and use:
const match = ; ; // baby; // child; // teenager; // student; // grownup
Feature
const rules = '17=Just 17' // strict 17;const match = ;; // Just 17; // false (no match)
Test
npm test