@fluid-experimental/property-changeset 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1

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.
Files changed (113) hide show
  1. package/README.md +1 -0
  2. package/dist/changeset.d.ts +2 -2
  3. package/dist/changeset.d.ts.map +1 -1
  4. package/dist/changeset.js +61 -45
  5. package/dist/changeset.js.map +1 -1
  6. package/dist/changeset_operations/array.d.ts +6 -6
  7. package/dist/changeset_operations/array.d.ts.map +1 -1
  8. package/dist/changeset_operations/array.js +87 -56
  9. package/dist/changeset_operations/array.js.map +1 -1
  10. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  11. package/dist/changeset_operations/arrayChangesetIterator.js +43 -41
  12. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  13. package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  14. package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
  15. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  16. package/dist/changeset_operations/indexedCollection.js +76 -44
  17. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  18. package/dist/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
  19. package/dist/changeset_operations/isEmptyChangeset.js +2 -1
  20. package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
  21. package/dist/changeset_operations/operationTypes.d.ts.map +1 -1
  22. package/dist/changeset_operations/operationTypes.js.map +1 -1
  23. package/dist/helpers/typeidHelper.d.ts +10 -10
  24. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  25. package/dist/helpers/typeidHelper.js +19 -17
  26. package/dist/helpers/typeidHelper.js.map +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/isReservedKeyword.d.ts.map +1 -1
  30. package/dist/isReservedKeyword.js.map +1 -1
  31. package/dist/pathHelper.d.ts.map +1 -1
  32. package/dist/pathHelper.js +16 -10
  33. package/dist/pathHelper.js.map +1 -1
  34. package/dist/rebase.d.ts.map +1 -1
  35. package/dist/rebase.js +20 -13
  36. package/dist/rebase.js.map +1 -1
  37. package/dist/templateSchema.d.ts.map +1 -1
  38. package/dist/templateSchema.js +10 -11
  39. package/dist/templateSchema.js.map +1 -1
  40. package/dist/templateValidator.d.ts.map +1 -1
  41. package/dist/templateValidator.js +135 -102
  42. package/dist/templateValidator.js.map +1 -1
  43. package/dist/test/array.spec.js +141 -343
  44. package/dist/test/array.spec.js.map +1 -1
  45. package/dist/test/pathHelper.spec.js +299 -166
  46. package/dist/test/pathHelper.spec.js.map +1 -1
  47. package/dist/test/reversibleCs.spec.js.map +1 -1
  48. package/dist/test/schemaValidator.js +3 -1
  49. package/dist/test/schemaValidator.js.map +1 -1
  50. package/dist/test/schemas/badBothPropertiesAndTypeid.js +8 -8
  51. package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
  52. package/dist/test/schemas/badInvalidSemverInTypeid.js +18 -16
  53. package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
  54. package/dist/test/schemas/badMissingSemverInTypeid.js +18 -16
  55. package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
  56. package/dist/test/schemas/badNestedProperties.js +18 -17
  57. package/dist/test/schemas/badNestedProperties.js.map +1 -1
  58. package/dist/test/schemas/badPrimitiveTypeid.js +9 -8
  59. package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
  60. package/dist/test/schemas/badVersionedTypeid.js +19 -17
  61. package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
  62. package/dist/test/schemas/goodColorPalette.js +4 -4
  63. package/dist/test/schemas/goodColorPalette.js.map +1 -1
  64. package/dist/test/schemas/goodDraftAsVersion.js +2 -4
  65. package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
  66. package/dist/test/schemas/goodPointId.js +18 -16
  67. package/dist/test/schemas/goodPointId.js.map +1 -1
  68. package/dist/test/schemas/goodReferenceAndRegular.js +5 -5
  69. package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
  70. package/dist/test/schemas/goodReservedTypes.js +8 -7
  71. package/dist/test/schemas/goodReservedTypes.js.map +1 -1
  72. package/dist/test/schemas/goodUIBorder.js +19 -16
  73. package/dist/test/schemas/goodUIBorder.js.map +1 -1
  74. package/dist/test/tsconfig.tsbuildinfo +1 -1
  75. package/dist/test/validator/templateSyntax.spec.js.map +1 -1
  76. package/dist/test/validator/templateValidator.spec.js +329 -306
  77. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  78. package/dist/test/validator/typeidHelper.spec.js +98 -65
  79. package/dist/test/validator/typeidHelper.spec.js.map +1 -1
  80. package/dist/utils.d.ts +1 -1
  81. package/dist/utils.d.ts.map +1 -1
  82. package/dist/utils.js +149 -95
  83. package/dist/utils.js.map +1 -1
  84. package/dist/validationResultBuilder.d.ts.map +1 -1
  85. package/dist/validationResultBuilder.js.map +1 -1
  86. package/lib/changeset.js +63 -47
  87. package/lib/changeset.js.map +1 -1
  88. package/lib/changeset_operations/array.js +88 -57
  89. package/lib/changeset_operations/array.js.map +1 -1
  90. package/lib/changeset_operations/arrayChangesetIterator.js +43 -41
  91. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  92. package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
  93. package/lib/changeset_operations/indexedCollection.js +76 -44
  94. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  95. package/lib/changeset_operations/isEmptyChangeset.js +2 -1
  96. package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
  97. package/lib/changeset_operations/operationTypes.js.map +1 -1
  98. package/lib/helpers/typeidHelper.js +19 -17
  99. package/lib/helpers/typeidHelper.js.map +1 -1
  100. package/lib/index.js.map +1 -1
  101. package/lib/isReservedKeyword.js.map +1 -1
  102. package/lib/pathHelper.js +17 -11
  103. package/lib/pathHelper.js.map +1 -1
  104. package/lib/rebase.js +20 -13
  105. package/lib/rebase.js.map +1 -1
  106. package/lib/templateSchema.js +10 -11
  107. package/lib/templateSchema.js.map +1 -1
  108. package/lib/templateValidator.js +135 -102
  109. package/lib/templateValidator.js.map +1 -1
  110. package/lib/utils.js +149 -95
  111. package/lib/utils.js.map +1 -1
  112. package/lib/validationResultBuilder.js.map +1 -1
  113. package/package.json +100 -100
@@ -9,99 +9,183 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  */
10
10
  const chai_1 = require("chai");
11
11
  const pathHelper_1 = require("../pathHelper");
12
- describe('PathHelper', function () {
13
- describe('tokenizePathString', function () {
14
- it('should work for simple paths separated by dots', function () {
12
+ describe("PathHelper", function () {
13
+ describe("tokenizePathString", function () {
14
+ it("should work for simple paths separated by dots", function () {
15
15
  let types = [];
16
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('', types)).to.deep.equal([]);
16
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("", types)).to.deep.equal([]);
17
17
  (0, chai_1.expect)(types).to.deep.equal([]);
18
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test', types)).to.deep.equal(['test']);
18
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("test", types)).to.deep.equal(["test"]);
19
19
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
20
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test.test2', types)).to.deep.equal(['test', 'test2']);
20
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("test.test2", types)).to.deep.equal([
21
+ "test",
22
+ "test2",
23
+ ]);
21
24
  (0, chai_1.expect)(types).to.deep.equal([
22
25
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
23
26
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
24
27
  ]);
25
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('.test2'); }).to.throw();
26
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test2.'); }).to.throw();
27
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('.'); }).to.throw();
28
- });
29
- it('should work for arrays', function () {
28
+ (0, chai_1.expect)(function () {
29
+ pathHelper_1.PathHelper.tokenizePathString(".test2");
30
+ }).to.throw();
31
+ (0, chai_1.expect)(function () {
32
+ pathHelper_1.PathHelper.tokenizePathString("test2.");
33
+ }).to.throw();
34
+ (0, chai_1.expect)(function () {
35
+ pathHelper_1.PathHelper.tokenizePathString(".");
36
+ }).to.throw();
37
+ });
38
+ it("should work for arrays", function () {
30
39
  let types = [];
31
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]', types)).to.deep.equal(['test']);
40
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test]", types)).to.deep.equal(["test"]);
32
41
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
33
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test][test2]', types)).to.deep.equal(['test', 'test2']);
34
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
35
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('['); }).to.throw();
36
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd'); }).to.throw();
37
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString(']'); }).to.throw();
38
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd]]'); }).to.throw();
39
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[]'); }).to.throw();
40
- });
41
- it('should work for combinations of arrays and paths separated by dots', function () {
42
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test][test2]", types)).to.deep.equal([
43
+ "test",
44
+ "test2",
45
+ ]);
46
+ (0, chai_1.expect)(types).to.deep.equal([
47
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
48
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
49
+ ]);
50
+ (0, chai_1.expect)(function () {
51
+ pathHelper_1.PathHelper.tokenizePathString("[");
52
+ }).to.throw();
53
+ (0, chai_1.expect)(function () {
54
+ pathHelper_1.PathHelper.tokenizePathString("[abcd");
55
+ }).to.throw();
56
+ (0, chai_1.expect)(function () {
57
+ pathHelper_1.PathHelper.tokenizePathString("]");
58
+ }).to.throw();
59
+ (0, chai_1.expect)(function () {
60
+ pathHelper_1.PathHelper.tokenizePathString("[abcd]]");
61
+ }).to.throw();
62
+ (0, chai_1.expect)(function () {
63
+ pathHelper_1.PathHelper.tokenizePathString("[]");
64
+ }).to.throw();
65
+ });
66
+ it("should work for combinations of arrays and paths separated by dots", function () {
42
67
  let types = [];
43
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('map[test]', types)).to.deep.equal(['map', 'test']);
44
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
45
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test].parameter', types)).to.deep.equal(['test', 'parameter']);
46
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
47
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('map[test].parameter[test2]', types)).to.deep.equal(['map', 'test', 'parameter', 'test2']);
68
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("map[test]", types)).to.deep.equal([
69
+ "map",
70
+ "test",
71
+ ]);
72
+ (0, chai_1.expect)(types).to.deep.equal([
73
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
74
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
75
+ ]);
76
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test].parameter", types)).to.deep.equal([
77
+ "test",
78
+ "parameter",
79
+ ]);
80
+ (0, chai_1.expect)(types).to.deep.equal([
81
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
82
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
83
+ ]);
84
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("map[test].parameter[test2]", types)).to.deep.equal(["map", "test", "parameter", "test2"]);
48
85
  (0, chai_1.expect)(types).to.deep.equal([
49
86
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
50
87
  pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
51
88
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
52
89
  pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
53
90
  ]);
54
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[test]parameter'); }).to.throw();
91
+ (0, chai_1.expect)(function () {
92
+ pathHelper_1.PathHelper.tokenizePathString("[test]parameter");
93
+ }).to.throw();
55
94
  });
56
- it('should work for quoted tokens', function () {
95
+ it("should work for quoted tokens", function () {
57
96
  let types = [];
58
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test"', types)).to.deep.equal(['test']);
97
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test"', types)).to.deep.equal(["test"]);
59
98
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
60
99
  (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"te\\"st"', types)).to.deep.equal(['te"st']);
61
100
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
62
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"te\\\\st"', types)).to.deep.equal(['te\\st']);
101
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"te\\\\st"', types)).to.deep.equal(["te\\st"]);
63
102
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
64
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""', types)).to.deep.equal(['']);
103
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""', types)).to.deep.equal([""]);
65
104
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
66
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1".test2', types)).to.deep.equal(['test1', 'test2']);
105
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1".test2', types)).to.deep.equal([
106
+ "test1",
107
+ "test2",
108
+ ]);
109
+ (0, chai_1.expect)(types).to.deep.equal([
110
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
111
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
112
+ ]);
113
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"."test2"', types)).to.deep.equal([
114
+ "test1",
115
+ "test2",
116
+ ]);
67
117
  (0, chai_1.expect)(types).to.deep.equal([
68
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
118
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
119
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
120
+ ]);
121
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1."test2"', types)).to.deep.equal([
122
+ "test1",
123
+ "test2",
69
124
  ]);
70
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"."test2"', types)).to.deep.equal(['test1', 'test2']);
71
125
  (0, chai_1.expect)(types).to.deep.equal([
72
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
126
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
127
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
128
+ ]);
129
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1["test2"]', types)).to.deep.equal([
130
+ "test1",
131
+ "test2",
132
+ ]);
133
+ (0, chai_1.expect)(types).to.deep.equal([
134
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
135
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
136
+ ]);
137
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"["test2"]', types)).to.deep.equal([
138
+ "test1",
139
+ "test2",
140
+ ]);
141
+ (0, chai_1.expect)(types).to.deep.equal([
142
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
143
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
73
144
  ]);
74
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1."test2"', types)).to.deep.equal(['test1', 'test2']);
145
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""[""]', types)).to.deep.equal(["", ""]);
75
146
  (0, chai_1.expect)(types).to.deep.equal([
76
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
77
- ]);
78
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1["test2"]', types)).to.deep.equal(['test1', 'test2']);
79
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
80
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"["test2"]', types)).to.deep.equal(['test1', 'test2']);
81
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
82
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""[""]', types)).to.deep.equal(['', '']);
83
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
84
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"/"', types)).to.deep.equal(['/']);
147
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
148
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
149
+ ]);
150
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"/"', types)).to.deep.equal(["/"]);
85
151
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
86
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/', types)).to.deep.equal(['/']);
152
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("/", types)).to.deep.equal(["/"]);
87
153
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN]);
88
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/test', types)).to.deep.equal(['/', 'test']);
89
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
90
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/[test]', types)).to.deep.equal(['/', 'test']);
91
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
92
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*', types)).to.deep.equal(['*']);
154
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("/test", types)).to.deep.equal(["/", "test"]);
155
+ (0, chai_1.expect)(types).to.deep.equal([
156
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN,
157
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
158
+ ]);
159
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("/[test]", types)).to.deep.equal(["/", "test"]);
160
+ (0, chai_1.expect)(types).to.deep.equal([
161
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN,
162
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
163
+ ]);
164
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("*", types)).to.deep.equal(["*"]);
93
165
  (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
94
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test*', types)).to.deep.equal(['test', '*']);
166
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("test*", types)).to.deep.equal(["test", "*"]);
95
167
  (0, chai_1.expect)(types).to.deep.equal([
96
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
168
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
169
+ pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
97
170
  ]);
98
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*.test', types)).to.deep.equal(['*', 'test']);
171
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("*.test", types)).to.deep.equal(["*", "test"]);
99
172
  (0, chai_1.expect)(types).to.deep.equal([
100
- pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
173
+ pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
174
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
175
+ ]);
176
+ (0, chai_1.expect)(function () {
177
+ pathHelper_1.PathHelper.tokenizePathString("*test", types);
178
+ }).to.throw();
179
+ (0, chai_1.expect)(function () {
180
+ pathHelper_1.PathHelper.tokenizePathString("test*test", types);
181
+ }).to.throw();
182
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("*.test*.test2*", types)).to.deep.equal([
183
+ "*",
184
+ "test",
185
+ "*",
186
+ "test2",
187
+ "*",
101
188
  ]);
102
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('*test', types); }).to.throw();
103
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test*test', types); }).to.throw();
104
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*.test*.test2*', types)).to.deep.equal(['*', 'test', '*', 'test2', '*']);
105
189
  (0, chai_1.expect)(types).to.deep.equal([
106
190
  pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
107
191
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
@@ -109,121 +193,170 @@ describe('PathHelper', function () {
109
193
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
110
194
  pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
111
195
  ]);
112
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/*', types)).to.deep.equal(['/', '*']);
113
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
114
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*[test]', types)).to.deep.equal(['*', 'test']);
115
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
116
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*', types)).to.deep.equal(['test', '*']);
117
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
118
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*.test2', types)).to.deep.equal(['test', '*', 'test2']);
196
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("/*", types)).to.deep.equal(["/", "*"]);
197
+ (0, chai_1.expect)(types).to.deep.equal([
198
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN,
199
+ pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
200
+ ]);
201
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("*[test]", types)).to.deep.equal(["*", "test"]);
202
+ (0, chai_1.expect)(types).to.deep.equal([
203
+ pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
204
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
205
+ ]);
206
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test]*", types)).to.deep.equal(["test", "*"]);
207
+ (0, chai_1.expect)(types).to.deep.equal([
208
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
209
+ pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
210
+ ]);
211
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test]*.test2", types)).to.deep.equal([
212
+ "test",
213
+ "*",
214
+ "test2",
215
+ ]);
119
216
  (0, chai_1.expect)(types).to.deep.equal([
120
217
  pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
121
218
  pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
122
219
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
123
220
  ]);
124
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*[test2]', types)).to.deep.equal(['test', '*', 'test2']);
221
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("[test]*[test2]", types)).to.deep.equal([
222
+ "test",
223
+ "*",
224
+ "test2",
225
+ ]);
125
226
  (0, chai_1.expect)(types).to.deep.equal([
126
227
  pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
127
228
  pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
128
229
  pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
129
230
  ]);
130
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[test]*test', types); }).to.throw();
131
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"'); }).to.throw();
132
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test"'); }).to.throw();
133
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"tests'); }).to.throw();
134
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"\\a"'); }).to.throw();
135
- });
136
- it('should work for relative paths', function () {
231
+ (0, chai_1.expect)(function () {
232
+ pathHelper_1.PathHelper.tokenizePathString("[test]*test", types);
233
+ }).to.throw();
234
+ (0, chai_1.expect)(function () {
235
+ pathHelper_1.PathHelper.tokenizePathString('"');
236
+ }).to.throw();
237
+ (0, chai_1.expect)(function () {
238
+ pathHelper_1.PathHelper.tokenizePathString('test"');
239
+ }).to.throw();
240
+ (0, chai_1.expect)(function () {
241
+ pathHelper_1.PathHelper.tokenizePathString('"tests');
242
+ }).to.throw();
243
+ (0, chai_1.expect)(function () {
244
+ pathHelper_1.PathHelper.tokenizePathString('"\\a"');
245
+ }).to.throw();
246
+ });
247
+ it("should work for relative paths", function () {
137
248
  let types = [];
138
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../test', types)).to.deep.equal(['../', 'test']);
139
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
249
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("../test", types)).to.deep.equal(["../", "test"]);
250
+ (0, chai_1.expect)(types).to.deep.equal([
251
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
140
252
  pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
141
253
  ]);
142
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../../../test', types)).to.deep.equal(['../', '../', '../', 'test']);
143
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
144
- pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
254
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("../../../test", types)).to.deep.equal([
255
+ "../",
256
+ "../",
257
+ "../",
258
+ "test",
145
259
  ]);
146
- (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../../test[0].test2[key]', types)).to.deep.equal(['../', '../', 'test', '0', 'test2', 'key']);
147
- (0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
148
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
149
- pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
260
+ (0, chai_1.expect)(types).to.deep.equal([
261
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
262
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
263
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
264
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
265
+ ]);
266
+ (0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString("../../test[0].test2[key]", types)).to.deep.equal([
267
+ "../",
268
+ "../",
269
+ "test",
270
+ "0",
271
+ "test2",
272
+ "key",
273
+ ]);
274
+ (0, chai_1.expect)(types).to.deep.equal([
275
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
276
+ pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
277
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
278
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
279
+ pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
280
+ pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
150
281
  ]);
151
- (0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('/../test2'); }).to.throw();
282
+ (0, chai_1.expect)(function () {
283
+ pathHelper_1.PathHelper.tokenizePathString("/../test2");
284
+ }).to.throw();
152
285
  });
153
286
  });
154
- describe('quotePathSegment', function () {
155
- it('should quote simple strings', function () {
156
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test')).to.equal('"test"');
157
- (0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('test'))).to.equal('test');
287
+ describe("quotePathSegment", function () {
288
+ it("should quote simple strings", function () {
289
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment("test")).to.equal('"test"');
290
+ (0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment("test"))).to.equal("test");
158
291
  });
159
- it('should correctly quote strings with a quotation mark', function () {
292
+ it("should correctly quote strings with a quotation mark", function () {
160
293
  (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('"')).to.equal('"\\""');
161
294
  (0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('"'))).to.equal('"');
162
295
  });
163
- it('should correctly quote strings with a backslash', function () {
164
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('\\')).to.equal('"\\\\"');
165
- (0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('\\'))).to.equal('\\');
296
+ it("should correctly quote strings with a backslash", function () {
297
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment("\\")).to.equal('"\\\\"');
298
+ (0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment("\\"))).to.equal("\\");
166
299
  });
167
- it('should work for paths with multiple occurrences of the test string', function () {
300
+ it("should work for paths with multiple occurrences of the test string", function () {
168
301
  (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test"property"')).to.equal('"test\\"property\\""');
169
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test\\property\\')).to.equal('"test\\\\property\\\\"');
302
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment("test\\property\\")).to.equal('"test\\\\property\\\\"');
170
303
  (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test"\\property\\"')).to.equal('"test\\"\\\\property\\\\\\""');
171
304
  });
172
305
  });
173
- describe('quotePathSegmentIfNeeded', function () {
174
- it('should quote all required strings', function () {
175
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('.')).to.equal('"."');
306
+ describe("quotePathSegmentIfNeeded", function () {
307
+ it("should quote all required strings", function () {
308
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded(".")).to.equal('"."');
176
309
  (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('"')).to.equal('"\\""');
177
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('\\')).to.equal('"\\\\"');
178
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('[')).to.equal('"["');
179
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded(']')).to.equal('"]"');
180
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('')).to.equal('""');
181
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('/')).to.equal('"/"');
182
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('*')).to.equal('"*"');
310
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("\\")).to.equal('"\\\\"');
311
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("[")).to.equal('"["');
312
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("]")).to.equal('"]"');
313
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("")).to.equal('""');
314
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("/")).to.equal('"/"');
315
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("*")).to.equal('"*"');
183
316
  });
184
- it('should not quote other strings', function () {
185
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('abcd')).to.equal('abcd');
186
- (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('test_string')).to.equal('test_string');
317
+ it("should not quote other strings", function () {
318
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("abcd")).to.equal("abcd");
319
+ (0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded("test_string")).to.equal("test_string");
187
320
  });
188
321
  });
189
- describe('unquotePathSegment', function () {
190
- it('should unquote simple strings', function () {
191
- (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test"')).to.equal('test');
322
+ describe("unquotePathSegment", function () {
323
+ it("should unquote simple strings", function () {
324
+ (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test"')).to.equal("test");
192
325
  });
193
- it('should correctly unquote strings with a quotation mark', function () {
326
+ it("should correctly unquote strings with a quotation mark", function () {
194
327
  (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"\\""')).to.equal('"');
195
328
  });
196
- it('should correctly unquote strings with a backslash', function () {
197
- (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"\\\\"')).to.equal('\\');
329
+ it("should correctly unquote strings with a backslash", function () {
330
+ (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"\\\\"')).to.equal("\\");
198
331
  });
199
- it('should work with empty strings', function () {
200
- (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('')).to.equal('');
332
+ it("should work with empty strings", function () {
333
+ (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment("")).to.equal("");
201
334
  });
202
- it('should throw on non strings', function () {
335
+ it("should throw on non strings", function () {
203
336
  // @ts-ignore
204
337
  (0, chai_1.expect)(() => pathHelper_1.PathHelper.unquotePathSegment(5)).to.throw();
205
338
  });
206
- it('should work for paths with multiple occurrences of the test string', function () {
339
+ it("should work for paths with multiple occurrences of the test string", function () {
207
340
  (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\"property\\""')).to.equal('test"property"');
208
- (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\\\property\\\\"')).to.equal('test\\property\\');
341
+ (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\\\property\\\\"')).to.equal("test\\property\\");
209
342
  (0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\"\\\\property\\\\\\""')).to.equal('test"\\property\\"');
210
343
  });
211
344
  });
212
- describe('convertAbsolutePathToCanonical', function () {
213
- it('should remove leading /', function () {
214
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c')).to.equal('a.b.c');
345
+ describe("convertAbsolutePathToCanonical", function () {
346
+ it("should remove leading /", function () {
347
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical("/a.b.c")).to.equal("a.b.c");
215
348
  });
216
- it('should throw on ../', function () {
217
- (0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('../a.b.c')).to.throw('../');
349
+ it("should throw on ../", function () {
350
+ (0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical("../a.b.c")).to.throw("../");
218
351
  });
219
- it('should throw on *', function () {
220
- (0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c*')).to.throw('*');
352
+ it("should throw on *", function () {
353
+ (0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical("/a.b.c*")).to.throw("*");
221
354
  });
222
- it('should replace square brackets by periods', function () {
223
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b[c]')).to.equal('a.b.c');
224
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a[b].c')).to.equal('a.b.c');
355
+ it("should replace square brackets by periods", function () {
356
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical("/a.b[c]")).to.equal("a.b.c");
357
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical("/a[b].c")).to.equal("a.b.c");
225
358
  });
226
- it('should keep properly escaped property names', function () {
359
+ it("should keep properly escaped property names", function () {
227
360
  (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"."')).to.equal('"."');
228
361
  (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\""')).to.equal('"\\""');
229
362
  (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\\\"')).to.equal('"\\\\"');
@@ -233,71 +366,71 @@ describe('PathHelper', function () {
233
366
  (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"/"')).to.equal('"/"');
234
367
  (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"*"')).to.equal('"*"');
235
368
  });
236
- it('should properly unescape unusually escaped property names', function () {
237
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"."b"')).to.equal('a.b');
238
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"[b]["c"]')).to.equal('a.b.c');
369
+ it("should properly unescape unusually escaped property names", function () {
370
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"."b"')).to.equal("a.b");
371
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"[b]["c"]')).to.equal("a.b.c");
239
372
  });
240
- it('should not modify simple paths', function () {
241
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('a.b.c.d')).to.equal('a.b.c.d');
242
- (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('test_string')).to.equal('test_string');
373
+ it("should not modify simple paths", function () {
374
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical("a.b.c.d")).to.equal("a.b.c.d");
375
+ (0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical("test_string")).to.equal("test_string");
243
376
  });
244
377
  });
245
- describe('getPathCoverage', function () {
378
+ describe("getPathCoverage", function () {
246
379
  this.timeout(500);
247
380
  let paths;
248
- it('should succeed if property is included in a path 1', function () {
249
- paths = ['a.b'];
250
- const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
381
+ it("should succeed if property is included in a path 1", function () {
382
+ paths = ["a.b"];
383
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.b", paths);
251
384
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
252
- (0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
385
+ (0, chai_1.expect)(res.pathList).to.deep.equal(["a.b"]);
253
386
  });
254
- it('should succeed if property is included in a path 2', function () {
255
- paths = ['a.b'];
256
- const res = pathHelper_1.PathHelper.getPathCoverage('a.b.c', paths);
387
+ it("should succeed if property is included in a path 2", function () {
388
+ paths = ["a.b"];
389
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.b.c", paths);
257
390
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
258
- (0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
391
+ (0, chai_1.expect)(res.pathList).to.deep.equal(["a.b"]);
259
392
  });
260
- it('should succeed if property is included in a path 3', function () {
261
- paths = ['a.b'];
262
- const res = pathHelper_1.PathHelper.getPathCoverage('a.b.c.d', paths);
393
+ it("should succeed if property is included in a path 3", function () {
394
+ paths = ["a.b"];
395
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.b.c.d", paths);
263
396
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
264
- (0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
397
+ (0, chai_1.expect)(res.pathList).to.deep.equal(["a.b"]);
265
398
  });
266
- it('should fail if property is not included in any path 1', function () {
267
- paths = ['a.b'];
268
- const res = pathHelper_1.PathHelper.getPathCoverage('b', paths);
399
+ it("should fail if property is not included in any path 1", function () {
400
+ paths = ["a.b"];
401
+ const res = pathHelper_1.PathHelper.getPathCoverage("b", paths);
269
402
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
270
403
  (0, chai_1.expect)(res.pathList).to.deep.equal([]);
271
404
  });
272
- it('should fail if property is not included in any path 2', function () {
273
- paths = ['a.b'];
274
- const res = pathHelper_1.PathHelper.getPathCoverage('b.f.g', paths);
405
+ it("should fail if property is not included in any path 2", function () {
406
+ paths = ["a.b"];
407
+ const res = pathHelper_1.PathHelper.getPathCoverage("b.f.g", paths);
275
408
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
276
409
  (0, chai_1.expect)(res.pathList).to.deep.equal([]);
277
410
  });
278
- it('should fail if property is not included in any path but have common root 1', function () {
279
- paths = ['a.b'];
280
- const res = pathHelper_1.PathHelper.getPathCoverage('a.h', paths);
411
+ it("should fail if property is not included in any path but have common root 1", function () {
412
+ paths = ["a.b"];
413
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.h", paths);
281
414
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
282
415
  (0, chai_1.expect)(res.pathList).to.deep.equal([]);
283
416
  });
284
- it('should fail if property is not included in any path but have common root 2', function () {
285
- paths = ['a.b'];
286
- const res = pathHelper_1.PathHelper.getPathCoverage('a.i.j', paths);
417
+ it("should fail if property is not included in any path but have common root 2", function () {
418
+ paths = ["a.b"];
419
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.i.j", paths);
287
420
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
288
421
  (0, chai_1.expect)(res.pathList).to.deep.equal([]);
289
422
  });
290
- it('should succeed if path goes through the property 1', function () {
291
- paths = ['a.b.c', 'a.b.d', 'z'];
292
- const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
423
+ it("should succeed if path goes through the property 1", function () {
424
+ paths = ["a.b.c", "a.b.d", "z"];
425
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.b", paths);
293
426
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
294
- (0, chai_1.expect)(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
427
+ (0, chai_1.expect)(res.pathList).to.deep.equal(["a.b.c", "a.b.d"]);
295
428
  });
296
- it('should succeed if path goes through the property 2', function () {
297
- paths = ['z', 'a.b.c', 'a.b.d'];
298
- const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
429
+ it("should succeed if path goes through the property 2", function () {
430
+ paths = ["z", "a.b.c", "a.b.d"];
431
+ const res = pathHelper_1.PathHelper.getPathCoverage("a.b", paths);
299
432
  (0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
300
- (0, chai_1.expect)(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
433
+ (0, chai_1.expect)(res.pathList).to.deep.equal(["a.b.c", "a.b.d"]);
301
434
  });
302
435
  });
303
436
  });