@fluid-experimental/property-changeset 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ajvFactory.cjs +19 -0
- package/dist/ajvFactory.cjs.map +1 -0
- package/dist/ajvFactory.d.cts +7 -0
- package/dist/ajvFactory.d.cts.map +1 -0
- package/dist/changeset.d.ts +3 -6
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js +75 -75
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts +6 -2
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js +94 -96
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.d.ts +2 -5
- package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.js +11 -12
- package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
- package/dist/changeset_operations/changesetConflictTypes.js +2 -2
- package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.d.ts +1 -4
- package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/dist/changeset_operations/indexedCollection.js +48 -49
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/changeset_operations/isEmptyChangeset.d.ts +1 -4
- package/dist/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
- package/dist/changeset_operations/isEmptyChangeset.js +9 -9
- package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
- package/dist/helpers/typeidHelper.d.ts +0 -3
- package/dist/helpers/typeidHelper.d.ts.map +1 -1
- package/dist/helpers/typeidHelper.js +10 -10
- package/dist/helpers/typeidHelper.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/isReservedKeyword.d.ts.map +1 -1
- package/dist/isReservedKeyword.js +2 -2
- package/dist/isReservedKeyword.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/pathHelper.d.ts +0 -3
- package/dist/pathHelper.d.ts.map +1 -1
- package/dist/pathHelper.js +2 -2
- package/dist/pathHelper.js.map +1 -1
- package/dist/rebase.js +8 -8
- package/dist/rebase.js.map +1 -1
- package/dist/templateSchema.d.ts.map +1 -1
- package/dist/templateSchema.js +2 -2
- package/dist/templateSchema.js.map +1 -1
- package/dist/templateValidator.d.ts +1 -1
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js +49 -54
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/array.spec.js +34 -36
- package/dist/test/array.spec.js.map +1 -1
- package/dist/test/indexedCollection.spec.js +9 -6
- package/dist/test/indexedCollection.spec.js.map +1 -1
- package/dist/test/map.spec.js +4 -4
- package/dist/test/map.spec.js.map +1 -1
- package/dist/test/pathHelper.spec.js +185 -185
- package/dist/test/pathHelper.spec.js.map +1 -1
- package/dist/test/reversibleCs.spec.js +5 -5
- package/dist/test/reversibleCs.spec.js.map +1 -1
- package/dist/test/schemaValidator.js +12 -11
- package/dist/test/schemaValidator.js.map +1 -1
- package/dist/test/schemas/badBothPropertiesAndTypeid.js +18 -18
- package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
- package/dist/test/schemas/badInvalidSemverInTypeid.js +40 -40
- package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
- package/dist/test/schemas/badMissingSemverInTypeid.js +40 -40
- package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/schemas/badNestedProperties.js +40 -40
- package/dist/test/schemas/badNestedProperties.js.map +1 -1
- package/dist/test/schemas/badPrimitiveTypeid.js +25 -25
- package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/schemas/badVersionedTypeid.js +41 -41
- package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
- package/dist/test/schemas/goodColorPalette.js +15 -15
- package/dist/test/schemas/goodColorPalette.js.map +1 -1
- package/dist/test/schemas/goodDraftAsVersion.js +12 -12
- package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
- package/dist/test/schemas/goodPointId.js +40 -40
- package/dist/test/schemas/goodPointId.js.map +1 -1
- package/dist/test/schemas/goodReferenceAndRegular.js +16 -16
- package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
- package/dist/test/schemas/goodReservedTypes.js +22 -22
- package/dist/test/schemas/goodReservedTypes.js.map +1 -1
- package/dist/test/schemas/goodUIBorder.js +34 -34
- package/dist/test/schemas/goodUIBorder.js.map +1 -1
- package/dist/test/schemas/index.js +55 -0
- package/dist/test/schemas/index.js.map +1 -0
- package/dist/test/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/test/validator/templateSyntax.spec.js +20 -25
- package/dist/test/validator/templateSyntax.spec.js.map +1 -1
- package/dist/test/validator/templateValidator.spec.js +118 -89
- package/dist/test/validator/templateValidator.spec.js.map +1 -1
- package/dist/test/validator/typeidHelper.spec.js +42 -41
- package/dist/test/validator/typeidHelper.spec.js.map +1 -1
- package/dist/utils.d.ts +17 -13
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +79 -79
- package/dist/utils.js.map +1 -1
- package/dist/validationResultBuilder.d.ts +2 -1
- package/dist/validationResultBuilder.d.ts.map +1 -1
- package/dist/validationResultBuilder.js.map +1 -1
- package/lib/ajvFactory.cjs +19 -0
- package/lib/ajvFactory.cjs.map +1 -0
- package/lib/ajvFactory.d.cts +7 -0
- package/lib/ajvFactory.d.cts.map +1 -0
- package/lib/changeset.d.ts +3 -6
- package/lib/changeset.d.ts.map +1 -1
- package/lib/changeset.js +16 -16
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.d.ts +6 -2
- package/lib/changeset_operations/array.d.ts.map +1 -1
- package/lib/changeset_operations/array.js +7 -9
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.d.ts +2 -5
- package/lib/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.js +3 -4
- package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/lib/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
- package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.d.ts +1 -4
- package/lib/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/lib/changeset_operations/indexedCollection.js +10 -11
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/changeset_operations/isEmptyChangeset.d.ts +1 -4
- package/lib/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
- package/lib/changeset_operations/isEmptyChangeset.js +3 -3
- package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
- package/lib/helpers/typeidHelper.d.ts +0 -3
- package/lib/helpers/typeidHelper.d.ts.map +1 -1
- package/lib/helpers/typeidHelper.js +1 -1
- package/lib/helpers/typeidHelper.js.map +1 -1
- package/lib/index.d.ts +8 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -8
- package/lib/index.js.map +1 -1
- package/lib/isReservedKeyword.d.ts.map +1 -1
- package/lib/isReservedKeyword.js.map +1 -1
- package/lib/pathHelper.d.ts +0 -3
- package/lib/pathHelper.d.ts.map +1 -1
- package/lib/pathHelper.js.map +1 -1
- package/lib/rebase.js +2 -2
- package/lib/rebase.js.map +1 -1
- package/lib/templateSchema.d.ts.map +1 -1
- package/lib/templateSchema.js.map +1 -1
- package/lib/templateValidator.d.ts +1 -1
- package/lib/templateValidator.d.ts.map +1 -1
- package/lib/templateValidator.js +24 -29
- package/lib/templateValidator.js.map +1 -1
- package/lib/test/array.spec.js +768 -0
- package/lib/test/array.spec.js.map +1 -0
- package/lib/test/indexedCollection.spec.js +75 -0
- package/lib/test/indexedCollection.spec.js.map +1 -0
- package/lib/test/map.spec.js +17 -0
- package/lib/test/map.spec.js.map +1 -0
- package/lib/test/pathHelper.spec.js +435 -0
- package/lib/test/pathHelper.spec.js.map +1 -0
- package/lib/test/reversibleCs.spec.js +42 -0
- package/lib/test/reversibleCs.spec.js.map +1 -0
- package/lib/test/schemaValidator.js +103 -0
- package/lib/test/schemaValidator.js.map +1 -0
- package/lib/test/schemas/badBothPropertiesAndTypeid.js +24 -0
- package/lib/test/schemas/badBothPropertiesAndTypeid.js.map +1 -0
- package/lib/test/schemas/badInvalidSemverInTypeid.js +46 -0
- package/lib/test/schemas/badInvalidSemverInTypeid.js.map +1 -0
- package/lib/test/schemas/badMissingSemverInTypeid.js +46 -0
- package/lib/test/schemas/badMissingSemverInTypeid.js.map +1 -0
- package/lib/test/schemas/badNestedProperties.js +46 -0
- package/lib/test/schemas/badNestedProperties.js.map +1 -0
- package/lib/test/schemas/badPrimitiveTypeid.js +31 -0
- package/lib/test/schemas/badPrimitiveTypeid.js.map +1 -0
- package/lib/test/schemas/badVersionedTypeid.js +47 -0
- package/lib/test/schemas/badVersionedTypeid.js.map +1 -0
- package/lib/test/schemas/goodColorPalette.js +21 -0
- package/lib/test/schemas/goodColorPalette.js.map +1 -0
- package/lib/test/schemas/goodDraftAsVersion.js +18 -0
- package/lib/test/schemas/goodDraftAsVersion.js.map +1 -0
- package/lib/test/schemas/goodPointId.js +46 -0
- package/lib/test/schemas/goodPointId.js.map +1 -0
- package/lib/test/schemas/goodReferenceAndRegular.js +22 -0
- package/lib/test/schemas/goodReferenceAndRegular.js.map +1 -0
- package/lib/test/schemas/goodReservedTypes.js +29 -0
- package/lib/test/schemas/goodReservedTypes.js.map +1 -0
- package/lib/test/schemas/goodUIBorder.js +41 -0
- package/lib/test/schemas/goodUIBorder.js.map +1 -0
- package/lib/test/schemas/index.js +29 -0
- package/lib/test/schemas/index.js.map +1 -0
- package/lib/test/tsconfig.tsbuildinfo +1 -0
- package/lib/test/validator/templateSyntax.spec.js +83 -0
- package/lib/test/validator/templateSyntax.spec.js.map +1 -0
- package/lib/test/validator/templateValidator.spec.js +1022 -0
- package/lib/test/validator/templateValidator.spec.js.map +1 -0
- package/lib/test/validator/typeidHelper.spec.js +142 -0
- package/lib/test/validator/typeidHelper.spec.js.map +1 -0
- package/lib/utils.d.ts +17 -13
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +23 -23
- package/lib/utils.js.map +1 -1
- package/lib/validationResultBuilder.d.ts +2 -1
- package/lib/validationResultBuilder.d.ts.map +1 -1
- package/lib/validationResultBuilder.js.map +1 -1
- package/package.json +37 -16
- package/dist/test/tsconfig.tsbuildinfo +0 -1
|
@@ -8,13 +8,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
/**
|
|
9
9
|
* @fileoverview In this file, we will test typeid_helper functions.
|
|
10
10
|
*/
|
|
11
|
+
const property_common_1 = require("@fluid-experimental/property-common");
|
|
11
12
|
const chai_1 = require("chai");
|
|
12
|
-
const
|
|
13
|
+
const typeidHelper_js_1 = require("../../helpers/typeidHelper.js");
|
|
13
14
|
(function () {
|
|
14
15
|
describe("Typeid helper", function () {
|
|
15
|
-
|
|
16
|
+
const MSG = property_common_1.constants.MSG;
|
|
16
17
|
it("getPrimitiveTypeId() should return all primitive typeids", () => {
|
|
17
|
-
const result =
|
|
18
|
+
const result = typeidHelper_js_1.TypeIdHelper.getPrimitiveTypeIds();
|
|
18
19
|
(0, chai_1.expect)(result).to.have.members([
|
|
19
20
|
"Float32",
|
|
20
21
|
"Float64",
|
|
@@ -33,7 +34,7 @@ const typeidHelper_1 = require("../../helpers/typeidHelper");
|
|
|
33
34
|
]);
|
|
34
35
|
});
|
|
35
36
|
it("getReservedTypeId() should return all reserved typeids", () => {
|
|
36
|
-
const result =
|
|
37
|
+
const result = typeidHelper_js_1.TypeIdHelper.getReservedTypeIds();
|
|
37
38
|
(0, chai_1.expect)(result).to.have.members([
|
|
38
39
|
"BaseProperty",
|
|
39
40
|
"ContainerProperty",
|
|
@@ -46,95 +47,95 @@ const typeidHelper_1 = require("../../helpers/typeidHelper");
|
|
|
46
47
|
describe("nativeInheritsFrom() method", function () {
|
|
47
48
|
it("should throw an error if the input is undefine", () => {
|
|
48
49
|
(0, chai_1.expect)(() => {
|
|
49
|
-
|
|
50
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom(undefined, "BaseProperty");
|
|
50
51
|
}).to.throw(MSG.TYPEID_NOT_DEFINED);
|
|
51
52
|
(0, chai_1.expect)(() => {
|
|
52
53
|
// @ts-ignore
|
|
53
|
-
|
|
54
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty");
|
|
54
55
|
}).to.throw(MSG.TYPEID_NOT_DEFINED);
|
|
55
56
|
(0, chai_1.expect)(() => {
|
|
56
57
|
// @ts-ignore
|
|
57
|
-
|
|
58
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom();
|
|
58
59
|
}).to.throw(MSG.TYPEID_NOT_DEFINED);
|
|
59
60
|
});
|
|
60
61
|
it("should throw an error if the inputs are not native typeids", () => {
|
|
61
62
|
(0, chai_1.expect)(() => {
|
|
62
|
-
|
|
63
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("template1", "BaseProperty");
|
|
63
64
|
}).to.throw(MSG.TYPEID_NOT_NATIVE + "template1");
|
|
64
65
|
(0, chai_1.expect)(() => {
|
|
65
|
-
|
|
66
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty", "template1");
|
|
66
67
|
}).to.throw(MSG.TYPEID_NOT_NATIVE + "template1");
|
|
67
68
|
});
|
|
68
69
|
it("should recognize that all the native type inherit from BaseProperty", () => {
|
|
69
|
-
(0, chai_1.expect)(
|
|
70
|
-
(0, chai_1.expect)(
|
|
71
|
-
(0, chai_1.expect)(
|
|
72
|
-
(0, chai_1.expect)(
|
|
73
|
-
(0, chai_1.expect)(
|
|
74
|
-
(0, chai_1.expect)(
|
|
75
|
-
(0, chai_1.expect)(
|
|
76
|
-
(0, chai_1.expect)(
|
|
77
|
-
(0, chai_1.expect)(
|
|
78
|
-
(0, chai_1.expect)(
|
|
79
|
-
(0, chai_1.expect)(
|
|
80
|
-
(0, chai_1.expect)(
|
|
81
|
-
(0, chai_1.expect)(
|
|
82
|
-
(0, chai_1.expect)(
|
|
83
|
-
(0, chai_1.expect)(
|
|
84
|
-
(0, chai_1.expect)(
|
|
70
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Int8", "BaseProperty")).to.be.true;
|
|
71
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Uint8", "BaseProperty")).to.be.true;
|
|
72
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Int16", "BaseProperty")).to.be.true;
|
|
73
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Uint16", "BaseProperty")).to.be.true;
|
|
74
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Int32", "BaseProperty")).to.be.true;
|
|
75
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Uint32", "BaseProperty")).to.be.true;
|
|
76
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Float32", "BaseProperty")).to.be.true;
|
|
77
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Int64", "BaseProperty")).to.be.true;
|
|
78
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Uint64", "BaseProperty")).to.be.true;
|
|
79
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Float64", "BaseProperty")).to.be.true;
|
|
80
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Bool", "BaseProperty")).to.be.true;
|
|
81
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Reference", "BaseProperty")).to.be.true;
|
|
82
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Enum", "BaseProperty")).to.be.true;
|
|
83
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("String", "BaseProperty")).to.be.true;
|
|
84
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty", "BaseProperty")).to.be.true;
|
|
85
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("ContainerProperty", "BaseProperty")).to.be
|
|
85
86
|
.true;
|
|
86
|
-
(0, chai_1.expect)(
|
|
87
|
-
(0, chai_1.expect)(
|
|
87
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NamedProperty", "BaseProperty")).to.be.true;
|
|
88
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NamedNodeProperty", "BaseProperty")).to.be
|
|
88
89
|
.true;
|
|
89
|
-
(0, chai_1.expect)(
|
|
90
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("RelationshipProperty", "BaseProperty")).to
|
|
90
91
|
.be.true;
|
|
91
|
-
(0, chai_1.expect)(
|
|
92
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Reference<NodeProperty>", "Reference")).to
|
|
92
93
|
.be.true;
|
|
93
|
-
(0, chai_1.expect)(
|
|
94
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty", "Reference<NodeProperty>"))
|
|
94
95
|
.to.be.false;
|
|
95
96
|
});
|
|
96
97
|
it("should recognize that the Reference<NodeProperty> inherits from BaseProperty", () => {
|
|
97
|
-
const result =
|
|
98
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Reference<NodeProperty>", "BaseProperty");
|
|
98
99
|
(0, chai_1.expect)(result).to.be.true;
|
|
99
100
|
});
|
|
100
101
|
it("should throw an error if in_typeid is enum<> ", () => {
|
|
101
102
|
(0, chai_1.expect)(() => {
|
|
102
|
-
|
|
103
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("enum<NodeProperty>", "BaseProperty");
|
|
103
104
|
}).to.throw(MSG.TYPEID_NOT_NATIVE + "enum<NodeProperty>");
|
|
104
105
|
});
|
|
105
106
|
it("should throw an error if base_typeid is enum<> ", () => {
|
|
106
107
|
(0, chai_1.expect)(() => {
|
|
107
|
-
|
|
108
|
+
typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty", "enum<NodeProperty>");
|
|
108
109
|
}).to.throw(MSG.TYPEID_NOT_NATIVE + "enum<NodeProperty>");
|
|
109
110
|
});
|
|
110
111
|
it("should recognize that the Enum inherits from Int32", () => {
|
|
111
|
-
const result =
|
|
112
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("Enum", "Int32");
|
|
112
113
|
(0, chai_1.expect)(result).to.be.true;
|
|
113
114
|
});
|
|
114
115
|
it("should recognize that the NodeProperty inherits from ContainerProperty", () => {
|
|
115
|
-
const result =
|
|
116
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NodeProperty", "ContainerProperty");
|
|
116
117
|
(0, chai_1.expect)(result).to.be.true;
|
|
117
118
|
});
|
|
118
119
|
it("should recognize that the NamedProperty inherits from ContainerProperty", () => {
|
|
119
|
-
const result =
|
|
120
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NamedProperty", "ContainerProperty");
|
|
120
121
|
(0, chai_1.expect)(result).to.be.true;
|
|
121
122
|
});
|
|
122
123
|
it("should recognize that the String inherits from ContainerProperty", () => {
|
|
123
|
-
const result =
|
|
124
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("String", "ContainerProperty");
|
|
124
125
|
(0, chai_1.expect)(result).to.be.true;
|
|
125
126
|
});
|
|
126
127
|
it("should recognize that the NamedNodeProperty inherits from NamedProperty", () => {
|
|
127
|
-
const result =
|
|
128
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NamedNodeProperty", "NamedProperty");
|
|
128
129
|
(0, chai_1.expect)(result).to.be.true;
|
|
129
130
|
});
|
|
130
131
|
it("should recognize that the NamedNodeProperty inherits from NodeProperty", () => {
|
|
131
|
-
const result =
|
|
132
|
+
const result = typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("NamedNodeProperty", "NodeProperty");
|
|
132
133
|
(0, chai_1.expect)(result).to.be.true;
|
|
133
134
|
});
|
|
134
135
|
it("should recognize that the RelationshipProperty inherits from NodeProperty and NamedProperty", () => {
|
|
135
|
-
(0, chai_1.expect)(
|
|
136
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("RelationshipProperty", "NodeProperty")).to
|
|
136
137
|
.be.true;
|
|
137
|
-
(0, chai_1.expect)(
|
|
138
|
+
(0, chai_1.expect)(typeidHelper_js_1.TypeIdHelper.nativeInheritsFrom("RelationshipProperty", "NamedProperty")).to
|
|
138
139
|
.be.true;
|
|
139
140
|
});
|
|
140
141
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeidHelper.spec.js","sourceRoot":"","sources":["../../../src/test/validator/typeidHelper.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,qCAAqC;AAErC;;GAEG;AAEH,+BAA8B;AAC9B,6DAA0D;AAE1D,CAAC;IACA,QAAQ,CAAC,eAAe,EAAE;QACzB,IAAI,GAAG,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;QAEvE,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YACnE,MAAM,MAAM,GAAG,2BAAY,CAAC,mBAAmB,EAAE,CAAC;YAClD,IAAA,a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AyE,EAAE,GAAG,EAAE;gBAClF,MAAM,MAAM,GAAG,2BAAY,CAAC,kBAAkB,CAC7C,mBAAmB,EACnB,eAAe,CACf,CAAC;gBAEF,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAC3B,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;gBACjF,MAAM,MAAM,GAAG,2BAAY,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;gBAEpF,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAC3B,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,6FAA6F,EAAE,GAAG,EAAE;gBACtG,IAAA,aAAM,EAAC,2BAAY,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE;qBAChF,EAAE,CAAC,IAAI,CAAC;gBACV,IAAA,aAAM,EAAC,2BAAY,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE;qBACjF,EAAE,CAAC,IAAI,CAAC;YACX,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint no-unused-expressions: 0 */\n\n/**\n * @fileoverview In this file, we will test typeid_helper functions.\n */\n\nimport { expect } from \"chai\";\nimport { TypeIdHelper } from \"../../helpers/typeidHelper\";\n\n(function () {\n\tdescribe(\"Typeid helper\", function () {\n\t\tvar MSG = require(\"@fluid-experimental/property-common\").constants.MSG;\n\n\t\tit(\"getPrimitiveTypeId() should return all primitive typeids\", () => {\n\t\t\tconst result = TypeIdHelper.getPrimitiveTypeIds();\n\t\t\texpect(result).to.have.members([\n\t\t\t\t\"Float32\",\n\t\t\t\t\"Float64\",\n\t\t\t\t\"Int8\",\n\t\t\t\t\"Uint8\",\n\t\t\t\t\"Int16\",\n\t\t\t\t\"Uint16\",\n\t\t\t\t\"Int32\",\n\t\t\t\t\"Uint32\",\n\t\t\t\t\"Bool\",\n\t\t\t\t\"String\",\n\t\t\t\t\"Reference\",\n\t\t\t\t\"Enum\",\n\t\t\t\t\"Int64\",\n\t\t\t\t\"Uint64\",\n\t\t\t]);\n\t\t});\n\n\t\tit(\"getReservedTypeId() should return all reserved typeids\", () => {\n\t\t\tconst result = TypeIdHelper.getReservedTypeIds();\n\n\t\t\texpect(result).to.have.members([\n\t\t\t\t\"BaseProperty\",\n\t\t\t\t\"ContainerProperty\",\n\t\t\t\t\"NamedProperty\",\n\t\t\t\t\"NodeProperty\",\n\t\t\t\t\"NamedNodeProperty\",\n\t\t\t\t\"RelationshipProperty\",\n\t\t\t]);\n\t\t});\n\n\t\tdescribe(\"nativeInheritsFrom() method\", function () {\n\t\t\tit(\"should throw an error if the input is undefine\", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(undefined, \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t\texpect(() => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t\texpect(() => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom();\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t});\n\n\t\t\tit(\"should throw an error if the inputs are not native typeids\", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"template1\", \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"template1\");\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"template1\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"template1\");\n\t\t\t});\n\n\t\t\tit(\"should recognize that all the native type inherit from BaseProperty\", () => {\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int8\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint8\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int16\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint16\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Float32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Float64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Bool\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Reference\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Enum\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"String\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"ContainerProperty\", \"BaseProperty\")).to.be\n\t\t\t\t\t.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NamedProperty\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NamedNodeProperty\", \"BaseProperty\")).to.be\n\t\t\t\t\t.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"BaseProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Reference<NodeProperty>\", \"Reference\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"Reference<NodeProperty>\"))\n\t\t\t\t\t.to.be.false;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the Reference<NodeProperty> inherits from BaseProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"Reference<NodeProperty>\",\n\t\t\t\t\t\"BaseProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should throw an error if in_typeid is enum<> \", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"enum<NodeProperty>\", \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"enum<NodeProperty>\");\n\t\t\t});\n\n\t\t\tit(\"should throw an error if base_typeid is enum<> \", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"enum<NodeProperty>\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"enum<NodeProperty>\");\n\t\t\t});\n\n\t\t\tit(\"should recognize that the Enum inherits from Int32\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"Enum\", \"Int32\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NodeProperty inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"ContainerProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedProperty inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"NamedProperty\",\n\t\t\t\t\t\"ContainerProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the String inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"String\", \"ContainerProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedNodeProperty inherits from NamedProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"NamedNodeProperty\",\n\t\t\t\t\t\"NamedProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedNodeProperty inherits from NodeProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"NamedNodeProperty\", \"NodeProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the RelationshipProperty inherits from NodeProperty and NamedProperty\", () => {\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"NodeProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"NamedProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t});\n\t\t});\n\t});\n})();\n"]}
|
|
1
|
+
{"version":3,"file":"typeidHelper.spec.js","sourceRoot":"","sources":["../../../src/test/validator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* Licensed under the MIT License.\n */\n\n/* eslint no-unused-expressions: 0 */\n\n/**\n * @fileoverview In this file, we will test typeid_helper functions.\n */\n\nimport { constants } from \"@fluid-experimental/property-common\";\nimport { expect } from \"chai\";\n\nimport { TypeIdHelper } from \"../../helpers/typeidHelper.js\";\n\n(function () {\n\tdescribe(\"Typeid helper\", function () {\n\t\tconst MSG = constants.MSG;\n\n\t\tit(\"getPrimitiveTypeId() should return all primitive typeids\", () => {\n\t\t\tconst result = TypeIdHelper.getPrimitiveTypeIds();\n\t\t\texpect(result).to.have.members([\n\t\t\t\t\"Float32\",\n\t\t\t\t\"Float64\",\n\t\t\t\t\"Int8\",\n\t\t\t\t\"Uint8\",\n\t\t\t\t\"Int16\",\n\t\t\t\t\"Uint16\",\n\t\t\t\t\"Int32\",\n\t\t\t\t\"Uint32\",\n\t\t\t\t\"Bool\",\n\t\t\t\t\"String\",\n\t\t\t\t\"Reference\",\n\t\t\t\t\"Enum\",\n\t\t\t\t\"Int64\",\n\t\t\t\t\"Uint64\",\n\t\t\t]);\n\t\t});\n\n\t\tit(\"getReservedTypeId() should return all reserved typeids\", () => {\n\t\t\tconst result = TypeIdHelper.getReservedTypeIds();\n\n\t\t\texpect(result).to.have.members([\n\t\t\t\t\"BaseProperty\",\n\t\t\t\t\"ContainerProperty\",\n\t\t\t\t\"NamedProperty\",\n\t\t\t\t\"NodeProperty\",\n\t\t\t\t\"NamedNodeProperty\",\n\t\t\t\t\"RelationshipProperty\",\n\t\t\t]);\n\t\t});\n\n\t\tdescribe(\"nativeInheritsFrom() method\", function () {\n\t\t\tit(\"should throw an error if the input is undefine\", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(undefined as unknown as string, \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t\texpect(() => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t\texpect(() => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom();\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_DEFINED);\n\t\t\t});\n\n\t\t\tit(\"should throw an error if the inputs are not native typeids\", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"template1\", \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"template1\");\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"template1\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"template1\");\n\t\t\t});\n\n\t\t\tit(\"should recognize that all the native type inherit from BaseProperty\", () => {\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int8\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint8\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int16\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint16\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Float32\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Int64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Uint64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Float64\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Bool\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Reference\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Enum\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"String\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"ContainerProperty\", \"BaseProperty\")).to.be\n\t\t\t\t\t.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NamedProperty\", \"BaseProperty\")).to.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NamedNodeProperty\", \"BaseProperty\")).to.be\n\t\t\t\t\t.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"BaseProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"Reference<NodeProperty>\", \"Reference\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"Reference<NodeProperty>\"))\n\t\t\t\t\t.to.be.false;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the Reference<NodeProperty> inherits from BaseProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"Reference<NodeProperty>\",\n\t\t\t\t\t\"BaseProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should throw an error if in_typeid is enum<> \", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"enum<NodeProperty>\", \"BaseProperty\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"enum<NodeProperty>\");\n\t\t\t});\n\n\t\t\tit(\"should throw an error if base_typeid is enum<> \", () => {\n\t\t\t\texpect(() => {\n\t\t\t\t\tTypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"enum<NodeProperty>\");\n\t\t\t\t}).to.throw(MSG.TYPEID_NOT_NATIVE + \"enum<NodeProperty>\");\n\t\t\t});\n\n\t\t\tit(\"should recognize that the Enum inherits from Int32\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"Enum\", \"Int32\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NodeProperty inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"NodeProperty\", \"ContainerProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedProperty inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"NamedProperty\",\n\t\t\t\t\t\"ContainerProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the String inherits from ContainerProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"String\", \"ContainerProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedNodeProperty inherits from NamedProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\n\t\t\t\t\t\"NamedNodeProperty\",\n\t\t\t\t\t\"NamedProperty\",\n\t\t\t\t);\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the NamedNodeProperty inherits from NodeProperty\", () => {\n\t\t\t\tconst result = TypeIdHelper.nativeInheritsFrom(\"NamedNodeProperty\", \"NodeProperty\");\n\n\t\t\t\texpect(result).to.be.true;\n\t\t\t});\n\n\t\t\tit(\"should recognize that the RelationshipProperty inherits from NodeProperty and NamedProperty\", () => {\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"NodeProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t\texpect(TypeIdHelper.nativeInheritsFrom(\"RelationshipProperty\", \"NamedProperty\")).to\n\t\t\t\t\t.be.true;\n\t\t\t});\n\t\t});\n\t});\n})();\n"]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
1
5
|
import { ErrorCallback } from "async";
|
|
2
|
-
import { SerializedChangeSet } from "./changeset";
|
|
3
|
-
import { ExtractedContext } from "./helpers/typeidHelper";
|
|
4
|
-
import { PathTree } from "./pathHelper";
|
|
6
|
+
import { SerializedChangeSet } from "./changeset.js";
|
|
7
|
+
import { ExtractedContext } from "./helpers/typeidHelper.js";
|
|
8
|
+
import { PathTree } from "./pathHelper.js";
|
|
5
9
|
/**
|
|
6
10
|
* Utils
|
|
7
11
|
* @alias property-changeset.Utils
|
|
@@ -357,11 +361,11 @@ export declare namespace Utils {
|
|
|
357
361
|
*
|
|
358
362
|
* ```typescript
|
|
359
363
|
* new Map([
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
364
|
+
* ['entry', new Map()],
|
|
365
|
+
* ['nested', new Map([
|
|
366
|
+
* ['entry2', new Map()],
|
|
367
|
+
* ['entry3', new Map()]
|
|
368
|
+
* ])]
|
|
365
369
|
* ])
|
|
366
370
|
* ```
|
|
367
371
|
*
|
|
@@ -369,11 +373,11 @@ export declare namespace Utils {
|
|
|
369
373
|
*
|
|
370
374
|
* ```typescript
|
|
371
375
|
* {
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
376
|
+
* entry: {},
|
|
377
|
+
* nested: {
|
|
378
|
+
* entry2: {}
|
|
379
|
+
* entry3: {}
|
|
380
|
+
* }
|
|
377
381
|
* }
|
|
378
382
|
* ```
|
|
379
383
|
*
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAC;AAU7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAc,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;;;GAKG;AAEH,yBAAiB,KAAK,CAAC;IACtB;;OAEG;IACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3D;;OAEG;IACH,MAAM,MAAM,qBAAqB,GAC9B,OAAO,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,cAAc,GACd,UAAU,CAAC;IAEd,UAAU,gBAAgB;QACzB;;WAEG;QACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,GAAG,CAAC;QACjD;;WAEG;QACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,GAAG,CAAC;QAClD;;WAEG;QACH,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAC;QAClC;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACpB;IAi9BD,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