@@ -22,14 +22,9 @@ export const setNormalizationHandler = (uri, handler) => {
2222export const evaluateSchema = ( schemaLocation , instance , context ) => {
2323 const instanceLocation = Instance . uri ( instance ) ;
2424
25- let valid = true ;
2625 /** @type API.NormalizedOutput */
2726 const output = { [ instanceLocation ] : { } } ;
2827
29- for ( const plugin of context . plugins ) {
30- plugin . beforeSchema ?. ( schemaLocation , instance , context ) ;
31- }
32-
3328 const schemaNode = context . ast [ schemaLocation ] ;
3429 if ( typeof schemaNode === "boolean" ) {
3530 output [ instanceLocation ] = {
@@ -44,18 +39,11 @@ export const evaluateSchema = (schemaLocation, instance, context) => {
4439
4540 const keywordContext = {
4641 ast : context . ast ,
47- errorIndex : context . errorIndex ,
48- plugins : context . plugins
42+ errorIndex : context . errorIndex
4943 } ;
50- for ( const plugin of context . plugins ) {
51- plugin . beforeKeyword ?. ( node , instance , keywordContext , context , keyword ) ;
52- }
5344
5445 const keywordOutput = keyword . evaluate ?. ( keywordValue , instance , keywordContext ) ;
5546 const isKeywordValid = ! context . errorIndex [ keywordLocation ] ?. [ instanceLocation ] ;
56- if ( ! isKeywordValid ) {
57- valid = false ;
58- }
5947
6048 if ( keyword . simpleApplicator ) {
6149 for ( const suboutput of ( keywordOutput ?? [ ] ) ) {
@@ -68,17 +56,9 @@ export const evaluateSchema = (schemaLocation, instance, context) => {
6856 output [ instanceLocation ] [ keywordUri ] ??= { } ;
6957 output [ instanceLocation ] [ keywordUri ] [ keywordLocation ] = isKeywordValid ;
7058 }
71-
72- for ( const plugin of context . plugins ) {
73- plugin . afterKeyword ?. ( node , instance , keywordContext , isKeywordValid , context , keyword ) ;
74- }
7559 }
7660 }
7761
78- for ( const plugin of context . plugins ) {
79- plugin . afterSchema ?. ( schemaLocation , instance , context , valid ) ;
80- }
81-
8262 return output ;
8363} ;
8464
@@ -142,6 +122,6 @@ export async function normalizedErrorOuput(instance, errorOutput, subjectUri) {
142122 const { schemaUri, ast } = await compile ( schema ) ;
143123 const value = Instance . fromJs ( instance ) ;
144124 /** @type API.EvaluationContext */
145- const context = { ast, errorIndex, plugins : [ ] } ;
125+ const context = { ast, errorIndex } ;
146126 return evaluateSchema ( schemaUri , value , context ) ;
147127}
0 commit comments