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

Method _removeDuplicateErrors

src/validator.js:970–986  ·  view source on GitHub ↗
(errors)

Source from the content-addressed store, hash-verified

968 }
969
970 _removeDuplicateErrors (errors) {
971 return errors.reduce((err, obj) => {
972 let first = true
973 if (!err) err = []
974 err.forEach(a => {
975 if (a.message === obj.message && a.path === obj.path && a.property === obj.property) {
976 a.errorcount++
977 first = false
978 }
979 })
980 if (first) {
981 obj.errorcount = 1
982 err.push(obj)
983 }
984 return err
985 }, [])
986 }
987
988 _checkType (type, value) {
989 const types = {

Callers 1

_validateSchemaMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected