MCPcopy Index your code
hub / github.com/Lemoncode/fonk / parsePattern

Function parsePattern

src/validators/pattern.ts:22–28  ·  view source on GitHub ↗
({ pattern }: PatternArgs)

Source from the content-addressed store, hash-verified

20}
21
22function parsePattern({ pattern }: PatternArgs): RegExp {
23 // Avoid RegExp like /true/ /false/ and /null/ without an explicit "true", "false" or "null"
24 if (typeof pattern === 'boolean' || pattern === null) {
25 throw new Error(BAD_PARAMETER);
26 }
27 return getRegExp(pattern);
28}
29
30export const validator: FieldValidationFunctionSync = fieldValidatorArgs => {
31 if (!fieldValidatorArgs.customArgs) {

Callers 1

validatorFunction · 0.85

Calls 1

getRegExpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…