Check if a string is in a list of strings.
I needed something to validate in the workflow-dispatch input to a Github Action
$ npm install in-string-list
import inStringList from 'in-string-list';
let inList = inStringList('major', 'major,minor', ',');
console.log(inList);
//=> true
const inList = inStringList('patch', 'major,minor', ',');
console.log(inList);
//=> false
Type: bool
Check if a string is in a list of strings seperated by a token.
$ npx in-string-list 'major' 'major+minor' '+'
$ npx in-string-list --help
Examples
$ in-string-list 'major' 'major+minor' '+'
exits with 0
$ in-string-list 'patch' 'majorxxminor' 'xx'
exits with 1