cypress-io / schema-tools

Validate, sanitize and document JSON schemas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add utility function to create Regex from list of allowed strings

bahmutov opened this issue ยท comments

So we can easily form regex for "one of these values" custom format

currently if the value is a string with possible values "foo", "bar", "baz" we have to code by hand

detect: /^(foo|bar|baz)$/

but could be really simple to write detect: regexOf('foo', 'bar', baz')

๐ŸŽ‰ This issue has been resolved in version 4.4.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€