Skip to content

Commit 5c29b4f

Browse files
committed
make sure the json type utility functions are exported
1 parent 30b68cc commit 5c29b4f

File tree

3 files changed

+43
-33
lines changed

3 files changed

+43
-33
lines changed

.changeset/khaki-pugs-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@neo4j/graph-schema-utils": patch
3+
---
4+
5+
make sure json type utility functions are also exported

packages/graph-schema-utils/src/formatters/json/extensions.ts

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ import {
2424
import {
2525
ConstraintJsonStruct,
2626
IndexJsonStruct,
27+
isLookupIndexJsonStruct,
28+
isNodeLabelConstraintJsonStruct,
29+
isNodeLabelIndexJsonStruct,
2730
isPrimitiveArrayPropertyTypeJsonStruct,
2831
isPrimitivePropertyTypeJsonStruct,
32+
isRelationshipTypeConstraintJsonStruct,
33+
isRelationshipTypeIndexJsonStruct,
2934
LookupIndexJsonStruct,
3035
NodeLabelConstraintJsonStruct,
3136
NodeLabelIndexJsonStruct,
@@ -584,36 +589,3 @@ const relationshipObjectType = {
584589
$ref: `#${relationshipObjectType.$id}`,
585590
}),
586591
};
587-
588-
export const isNodeLabelConstraintJsonStruct = (
589-
constraint: ConstraintJsonStruct
590-
): constraint is NodeLabelConstraintJsonStruct => {
591-
return constraint.entityType === "node" && constraint.nodeLabel !== undefined;
592-
};
593-
594-
export const isRelationshipTypeConstraintJsonStruct = (
595-
constraint: ConstraintJsonStruct
596-
): constraint is RelationshipTypeConstraintJsonStruct => {
597-
return (
598-
constraint.entityType === "relationship" &&
599-
constraint.relationshipType !== undefined
600-
);
601-
};
602-
603-
export const isNodeLabelIndexJsonStruct = (
604-
index: IndexJsonStruct
605-
): index is NodeLabelIndexJsonStruct => {
606-
return index.nodeLabel !== undefined && index.indexType !== "lookup";
607-
};
608-
609-
export const isRelationshipTypeIndexJsonStruct = (
610-
index: IndexJsonStruct
611-
): index is RelationshipTypeIndexJsonStruct => {
612-
return index.relationshipType !== undefined && index.indexType !== "lookup";
613-
};
614-
615-
export const isLookupIndexJsonStruct = (
616-
index: IndexJsonStruct
617-
): index is LookupIndexJsonStruct => {
618-
return index.indexType === "lookup";
619-
};

packages/graph-schema-utils/src/formatters/json/types.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,36 @@ export const isPrimitiveArrayPropertyTypeJsonStruct = (
140140
propertyType.items !== undefined
141141
);
142142
};
143+
144+
export const isNodeLabelConstraintJsonStruct = (
145+
constraint: ConstraintJsonStruct
146+
): constraint is NodeLabelConstraintJsonStruct => {
147+
return constraint.entityType === "node" && constraint.nodeLabel !== undefined;
148+
};
149+
150+
export const isRelationshipTypeConstraintJsonStruct = (
151+
constraint: ConstraintJsonStruct
152+
): constraint is RelationshipTypeConstraintJsonStruct => {
153+
return (
154+
constraint.entityType === "relationship" &&
155+
constraint.relationshipType !== undefined
156+
);
157+
};
158+
159+
export const isNodeLabelIndexJsonStruct = (
160+
index: IndexJsonStruct
161+
): index is NodeLabelIndexJsonStruct => {
162+
return index.nodeLabel !== undefined && index.indexType !== "lookup";
163+
};
164+
165+
export const isRelationshipTypeIndexJsonStruct = (
166+
index: IndexJsonStruct
167+
): index is RelationshipTypeIndexJsonStruct => {
168+
return index.relationshipType !== undefined && index.indexType !== "lookup";
169+
};
170+
171+
export const isLookupIndexJsonStruct = (
172+
index: IndexJsonStruct
173+
): index is LookupIndexJsonStruct => {
174+
return index.indexType === "lookup";
175+
};

0 commit comments

Comments
 (0)