File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,18 +61,7 @@ export const duplicateIdentifierMatcher = (index: number) => {
6161}
6262
6363export const duplicateKeywordMatcher = ( index : number ) => {
64- return ( error : ErrorObject ) => {
65- if ( error . instancePath !== '/keywords' ) {
66- return false
67- }
68- if ( error . schemaPath !== '#/properties/keywords/uniqueItems' ) {
69- return false
70- }
71- if ( error . params . i !== index && error . params . j !== index ) {
72- return false
73- }
74- return true
75- }
64+ return ( error : ErrorObject ) => error . params . i === index || error . params . j === index
7665}
7766
7867export const byError = ( errors : ErrorObject [ ] , matcher : Comparator = defaultMatcher ) => {
@@ -125,7 +114,10 @@ export const duplicateIdentifierQueries: ErrorQuery[] = [{
125114} ]
126115
127116export const duplicateKeywordQueries : ErrorQuery [ ] = [ {
128- find : { } ,
117+ find : {
118+ instancePath : '/keywords' ,
119+ schemaPath : '#/properties/keywords/uniqueItems'
120+ } ,
129121 replace : {
130122 message : 'This keyword is a duplicate.'
131123 }
You can’t perform that action at this time.
0 commit comments