You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yarn add detect-string-format
import returnFormatDetector from "detect-string-format";
usage
// quick start with default formats:constfastDetect=returnFormatDetector({});// returns a functionconstresults=fastDetect(["0.0.0.0","127.0.0.53","127.0.0.1"]);
defaults:
constschemas: JSONSchema7=["date","time","date-time","uri","url","email","ipv4","ipv6","uuid"].map(format=>({ format }));// you may want to add any of these:// ["hostname", "json-pointer", "json-pointer-uri-fragment", "relative-json-pointer", "uri-reference", "regex"];
add custom formats/schemas
The following example matches a simple North American telephone number with an optional area code: