@@ -3,6 +3,9 @@ import { createPredicate } from '@swagger-api/apidom-core';
3
3
import WorkflowsSpecification1Element from './elements/WorkflowsSpecification1' ;
4
4
import WorkflowsSpecElement from './elements/WorkflowsSpec' ;
5
5
import InfoElement from './elements/Info' ;
6
+ import SourceDescriptionElement from './elements/SourceDescription' ;
7
+ // NCE types
8
+ import SourceDescriptionsElement from './elements/nces/SourceDescriptions' ;
6
9
7
10
export const isWorkflowsSpecElement = createPredicate (
8
11
( { hasBasicElementProps, isElementType, primitiveEq } ) => {
@@ -36,3 +39,24 @@ export const isInfoElement = createPredicate(
36
39
hasClass ( 'info' , element ) ) ;
37
40
} ,
38
41
) ;
42
+
43
+ export const isSourceDescriptionElement = createPredicate (
44
+ ( { hasBasicElementProps, isElementType, primitiveEq } ) => {
45
+ return ( element : unknown ) : element is SourceDescriptionElement =>
46
+ element instanceof SourceDescriptionElement ||
47
+ ( hasBasicElementProps ( element ) &&
48
+ isElementType ( 'sourceDescription' , element ) &&
49
+ primitiveEq ( 'object' , element ) ) ;
50
+ } ,
51
+ ) ;
52
+
53
+ export const isSourceDescriptionsElement = createPredicate (
54
+ ( { hasBasicElementProps, isElementType, primitiveEq, hasClass } ) => {
55
+ return ( element : unknown ) : element is SourceDescriptionsElement =>
56
+ element instanceof SourceDescriptionsElement ||
57
+ ( hasBasicElementProps ( element ) &&
58
+ isElementType ( 'sourceDescriptions' , element ) &&
59
+ primitiveEq ( 'array' , element ) &&
60
+ hasClass ( 'sourceDescriptions' , element ) ) ;
61
+ } ,
62
+ ) ;
0 commit comments