1
- import { Element , hasElementSourceMap , toValue } from '@swagger-api/apidom-core' ;
1
+ import { Element } from '@swagger-api/apidom-core' ;
2
2
import { ApiDOMErrorOptions } from '@swagger-api/apidom-error' ;
3
3
4
4
import RelativeJsonPointerError from './RelativeJsonPointerError' ;
@@ -21,17 +21,11 @@ class EvaluationRelativeJsonPointerError<
21
21
> extends RelativeJsonPointerError {
22
22
public readonly relativePointer ! : string ;
23
23
24
- public readonly currentElement ! : string ;
24
+ public readonly currentElement ! : T ;
25
25
26
- public readonly currentElementSourceMap ?: [ [ number , number , number ] , [ number , number , number ] ] ;
26
+ public readonly rootElement ! : U ;
27
27
28
- public readonly rootElement ! : string ;
29
-
30
- public readonly rootElementSourceMap ?: [ [ number , number , number ] , [ number , number , number ] ] ;
31
-
32
- public readonly cursorElement ?: string ;
33
-
34
- public readonly cursorElementSourceMap ?: [ [ number , number , number ] , [ number , number , number ] ] ;
28
+ public readonly cursorElement ?: V ;
35
29
36
30
constructor (
37
31
message ?: string ,
@@ -41,29 +35,9 @@ class EvaluationRelativeJsonPointerError<
41
35
42
36
if ( typeof structuredOptions !== 'undefined' ) {
43
37
this . relativePointer = structuredOptions . relativePointer ;
44
-
45
- this . currentElement = structuredOptions . currentElement . element ;
46
- if ( hasElementSourceMap ( structuredOptions . currentElement ) ) {
47
- this . currentElementSourceMap = toValue (
48
- structuredOptions . currentElement . getMetaProperty ( 'sourceMap' ) ,
49
- ) ;
50
- }
51
-
52
- this . rootElement = structuredOptions . rootElement . element ;
53
- if ( hasElementSourceMap ( structuredOptions . rootElement ) ) {
54
- this . rootElementSourceMap = toValue (
55
- structuredOptions . rootElement . getMetaProperty ( 'sourceMap' ) ,
56
- ) ;
57
- }
58
-
59
- if ( typeof structuredOptions . cursorElement !== 'undefined' ) {
60
- this . cursorElement = structuredOptions . cursorElement . element ;
61
- if ( hasElementSourceMap ( structuredOptions . cursorElement ) ) {
62
- this . cursorElementSourceMap = toValue (
63
- structuredOptions . cursorElement . getMetaProperty ( 'sourceMap' ) ,
64
- ) ;
65
- }
66
- }
38
+ this . currentElement = structuredOptions . currentElement ;
39
+ this . rootElement = structuredOptions . rootElement ;
40
+ this . cursorElement = structuredOptions . cursorElement ;
67
41
}
68
42
}
69
43
}
0 commit comments