MCPcopy Create free account
hub / github.com/json-editor/json-editor / patternProperties

Method patternProperties

src/validator.js:497–510  ·  view source on GitHub ↗
(schema, value, path, validatedProperties)

Source from the content-addressed store, hash-verified

495 return errors
496 },
497 patternProperties (schema, value, path, validatedProperties) {
498 const errors = []
499 Object.entries(schema.patternProperties).forEach(([i, prop]) => {
500 const regex = new RegExp(i)
501 /* Check which properties match */
502 Object.entries(value).forEach(([j, v]) => {
503 if (regex.test(j)) {
504 validatedProperties[j] = true
505 errors.push(...this._validateSchema(prop, v, `${path}.${j}`))
506 }
507 })
508 })
509 return errors
510 }
511 }
512
513 this._validateObjectSubSchema2 = {

Callers

nothing calls this directly

Calls 1

_validateSchemaMethod · 0.95

Tested by

no test coverage detected