@warp-drive/legacy 5.8.0-alpha.4 → 5.8.0-alpha.41

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 (214) hide show
  1. package/README.md +14 -27
  2. package/declarations/adapter/error.d.ts +7 -7
  3. package/declarations/adapter/json-api.d.ts +6 -8
  4. package/declarations/adapter/rest.d.ts +26 -112
  5. package/declarations/adapter.d.ts +6 -8
  6. package/declarations/compat/-private.d.ts +1 -1
  7. package/declarations/compat/builders/find-all.d.ts +6 -6
  8. package/declarations/compat/builders/find-record.d.ts +8 -8
  9. package/declarations/compat/builders/query.d.ts +12 -12
  10. package/declarations/compat/extensions.d.ts +1 -1
  11. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +7 -9
  12. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +20 -30
  13. package/declarations/compat/utils.d.ts +17 -17
  14. package/declarations/compat.d.ts +35 -11
  15. package/declarations/index.d.ts +70 -0
  16. package/declarations/model/-private/attr.d.ts +5 -6
  17. package/declarations/model/-private/belongs-to.d.ts +4 -5
  18. package/declarations/model/-private/has-many.d.ts +4 -5
  19. package/declarations/model/-private/hooks.d.ts +1 -1
  20. package/declarations/model/-private/legacy-relationships-support.d.ts +2 -2
  21. package/declarations/model/-private/model.d.ts +18 -59
  22. package/declarations/model/-private/promise-many-array.d.ts +0 -18
  23. package/declarations/model/-private/record-state.d.ts +1 -1
  24. package/declarations/model/-private/references/belongs-to.d.ts +19 -29
  25. package/declarations/model/-private/references/has-many.d.ts +14 -16
  26. package/declarations/model/migration-support.d.ts +46 -21
  27. package/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  28. package/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  29. package/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  30. package/declarations/model-fragments/index.d.ts +5 -0
  31. package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  32. package/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  33. package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  34. package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  35. package/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  36. package/declarations/model-fragments.d.ts +9 -0
  37. package/declarations/model.d.ts +2 -2
  38. package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -6
  39. package/declarations/serializer/-private/transforms/boolean.d.ts +2 -2
  40. package/declarations/serializer/-private/transforms/date.d.ts +2 -2
  41. package/declarations/serializer/-private/transforms/number.d.ts +1 -1
  42. package/declarations/serializer/-private/transforms/string.d.ts +1 -1
  43. package/declarations/serializer/json-api.d.ts +11 -12
  44. package/declarations/serializer/json.d.ts +9 -11
  45. package/declarations/serializer/rest.d.ts +4 -6
  46. package/declarations/serializer.d.ts +9 -12
  47. package/dist/{-private-8UmnAf9J.js → -private-BG3bMiKp.js} +3 -2
  48. package/dist/adapter/-private.js +1 -1
  49. package/dist/adapter/error.js +14 -15
  50. package/dist/adapter/json-api.js +4 -1
  51. package/dist/adapter/rest.js +38 -125
  52. package/dist/adapter.js +6 -8
  53. package/dist/compat/-private.js +1 -1
  54. package/dist/compat/builders.js +26 -26
  55. package/dist/compat/utils.js +17 -18
  56. package/dist/compat.js +61 -43
  57. package/dist/{errors-8kD2mSe_.js → errors-Cz5KrzBk.js} +115 -122
  58. package/dist/hooks-D6diaM34.js +74 -0
  59. package/dist/index.js +195 -0
  60. package/dist/{json-DziiodPf.js → json-ChdEfB0X.js} +18 -35
  61. package/dist/model/-private.js +1 -1
  62. package/dist/model/migration-support.js +57 -25
  63. package/dist/model-for-CqXsIKws.js +221 -0
  64. package/dist/model-fragments.js +76 -0
  65. package/dist/model.js +18 -90
  66. package/dist/{schema-provider-DQu4Rjco.js → schema-provider-DJCV_6AF.js} +50 -95
  67. package/dist/{serialize-into-hash-CS0MIv4F.js → serialize-into-hash-DPZYoF-i.js} +1 -1
  68. package/dist/serializer/json-api.js +18 -45
  69. package/dist/serializer/json.js +1 -1
  70. package/dist/serializer/rest.js +14 -21
  71. package/dist/serializer/transform.js +15 -6
  72. package/dist/serializer.js +9 -13
  73. package/dist/store.js +5 -1
  74. package/dist/unpkg/dev/-private-DtjBbEgy.js +1206 -0
  75. package/dist/unpkg/dev/adapter/-private.js +1 -0
  76. package/dist/unpkg/dev/adapter/error.js +335 -0
  77. package/dist/unpkg/dev/adapter/json-api.js +271 -0
  78. package/dist/unpkg/dev/adapter/rest.js +1171 -0
  79. package/dist/unpkg/dev/adapter.js +1252 -0
  80. package/dist/unpkg/dev/compat/-private.js +1 -0
  81. package/dist/unpkg/dev/compat/builders.js +275 -0
  82. package/dist/unpkg/dev/compat/extensions.js +242 -0
  83. package/dist/unpkg/dev/compat/utils.js +223 -0
  84. package/dist/unpkg/dev/compat.js +1147 -0
  85. package/dist/unpkg/dev/errors-DmGGJr3T.js +2562 -0
  86. package/dist/unpkg/dev/hooks-CkYiE6Ud.js +73 -0
  87. package/dist/unpkg/dev/index.js +197 -0
  88. package/dist/unpkg/dev/json-Cu1LNgmQ.js +1256 -0
  89. package/dist/unpkg/dev/model/-private.js +1 -0
  90. package/dist/unpkg/dev/model/migration-support.js +553 -0
  91. package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
  92. package/dist/unpkg/dev/model-fragments.js +76 -0
  93. package/dist/unpkg/dev/model.js +678 -0
  94. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  95. package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +2186 -0
  96. package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +259 -0
  97. package/dist/unpkg/dev/serializer/json-api.js +649 -0
  98. package/dist/unpkg/dev/serializer/json.js +4 -0
  99. package/dist/unpkg/dev/serializer/rest.js +1242 -0
  100. package/dist/unpkg/dev/serializer/transform.js +278 -0
  101. package/dist/unpkg/dev/serializer.js +248 -0
  102. package/dist/unpkg/dev/store.js +637 -0
  103. package/dist/unpkg/dev/util-DvanW33H.js +20 -0
  104. package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
  105. package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +1206 -0
  106. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
  107. package/dist/unpkg/dev-deprecated/adapter/error.js +335 -0
  108. package/dist/unpkg/dev-deprecated/adapter/json-api.js +271 -0
  109. package/dist/unpkg/dev-deprecated/adapter/rest.js +1171 -0
  110. package/dist/unpkg/dev-deprecated/adapter.js +1252 -0
  111. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
  112. package/dist/unpkg/dev-deprecated/compat/builders.js +275 -0
  113. package/dist/unpkg/dev-deprecated/compat/extensions.js +242 -0
  114. package/dist/unpkg/dev-deprecated/compat/utils.js +223 -0
  115. package/dist/unpkg/dev-deprecated/compat.js +1147 -0
  116. package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +2565 -0
  117. package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +73 -0
  118. package/dist/unpkg/dev-deprecated/index.js +196 -0
  119. package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +1256 -0
  120. package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
  121. package/dist/unpkg/dev-deprecated/model/migration-support.js +570 -0
  122. package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
  123. package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
  124. package/dist/unpkg/dev-deprecated/model.js +682 -0
  125. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  126. package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +2211 -0
  127. package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +259 -0
  128. package/dist/unpkg/dev-deprecated/serializer/json-api.js +649 -0
  129. package/dist/unpkg/dev-deprecated/serializer/json.js +4 -0
  130. package/dist/unpkg/dev-deprecated/serializer/rest.js +1242 -0
  131. package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
  132. package/dist/unpkg/dev-deprecated/serializer.js +248 -0
  133. package/dist/unpkg/dev-deprecated/store.js +637 -0
  134. package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +24 -0
  135. package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
  136. package/dist/unpkg/prod/-private-BdyZaGEh.js +971 -0
  137. package/dist/unpkg/prod/adapter/-private.js +1 -0
  138. package/dist/unpkg/prod/adapter/error.js +330 -0
  139. package/dist/unpkg/prod/adapter/json-api.js +266 -0
  140. package/dist/unpkg/prod/adapter/rest.js +1134 -0
  141. package/dist/unpkg/prod/adapter.js +1219 -0
  142. package/dist/unpkg/prod/compat/-private.js +1 -0
  143. package/dist/unpkg/prod/compat/builders.js +210 -0
  144. package/dist/unpkg/prod/compat/extensions.js +232 -0
  145. package/dist/unpkg/prod/compat/utils.js +218 -0
  146. package/dist/unpkg/prod/compat.js +727 -0
  147. package/dist/unpkg/prod/errors-BGVFCBmi.js +2314 -0
  148. package/dist/unpkg/prod/hooks-BztVA_x0.js +41 -0
  149. package/dist/unpkg/prod/index.js +151 -0
  150. package/dist/unpkg/prod/json-BWrZ5546.js +1243 -0
  151. package/dist/unpkg/prod/model/-private.js +1 -0
  152. package/dist/unpkg/prod/model/migration-support.js +546 -0
  153. package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
  154. package/dist/unpkg/prod/model-fragments.js +76 -0
  155. package/dist/unpkg/prod/model.js +593 -0
  156. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  157. package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +1861 -0
  158. package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +215 -0
  159. package/dist/unpkg/prod/serializer/json-api.js +592 -0
  160. package/dist/unpkg/prod/serializer/json.js +4 -0
  161. package/dist/unpkg/prod/serializer/rest.js +1210 -0
  162. package/dist/unpkg/prod/serializer/transform.js +278 -0
  163. package/dist/unpkg/prod/serializer.js +248 -0
  164. package/dist/unpkg/prod/store.js +505 -0
  165. package/dist/unpkg/prod/util-DvanW33H.js +20 -0
  166. package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
  167. package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +971 -0
  168. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
  169. package/dist/unpkg/prod-deprecated/adapter/error.js +330 -0
  170. package/dist/unpkg/prod-deprecated/adapter/json-api.js +266 -0
  171. package/dist/unpkg/prod-deprecated/adapter/rest.js +1134 -0
  172. package/dist/unpkg/prod-deprecated/adapter.js +1219 -0
  173. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
  174. package/dist/unpkg/prod-deprecated/compat/builders.js +210 -0
  175. package/dist/unpkg/prod-deprecated/compat/extensions.js +232 -0
  176. package/dist/unpkg/prod-deprecated/compat/utils.js +218 -0
  177. package/dist/unpkg/prod-deprecated/compat.js +727 -0
  178. package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +2317 -0
  179. package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +41 -0
  180. package/dist/unpkg/prod-deprecated/index.js +150 -0
  181. package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +1243 -0
  182. package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
  183. package/dist/unpkg/prod-deprecated/model/migration-support.js +563 -0
  184. package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
  185. package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
  186. package/dist/unpkg/prod-deprecated/model.js +596 -0
  187. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  188. package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +1904 -0
  189. package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +215 -0
  190. package/dist/unpkg/prod-deprecated/serializer/json-api.js +592 -0
  191. package/dist/unpkg/prod-deprecated/serializer/json.js +4 -0
  192. package/dist/unpkg/prod-deprecated/serializer/rest.js +1210 -0
  193. package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
  194. package/dist/unpkg/prod-deprecated/serializer.js +248 -0
  195. package/dist/unpkg/prod-deprecated/store.js +505 -0
  196. package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +23 -0
  197. package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
  198. package/logos/README.md +2 -2
  199. package/logos/logo-yellow-slab.svg +1 -0
  200. package/logos/word-mark-black.svg +1 -0
  201. package/logos/word-mark-white.svg +1 -0
  202. package/package.json +14 -6
  203. package/logos/NCC-1701-a-blue.svg +0 -4
  204. package/logos/NCC-1701-a-gold.svg +0 -4
  205. package/logos/NCC-1701-a-gold_100.svg +0 -1
  206. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  207. package/logos/NCC-1701-a.svg +0 -4
  208. package/logos/docs-badge.svg +0 -2
  209. package/logos/ember-data-logo-dark.svg +0 -12
  210. package/logos/ember-data-logo-light.svg +0 -12
  211. package/logos/social1.png +0 -0
  212. package/logos/social2.png +0 -0
  213. package/logos/warp-drive-logo-dark.svg +0 -4
  214. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -0,0 +1,223 @@
1
+ import { singularize, dasherize } from '@warp-drive/utilities/string';
2
+
3
+ /**
4
+ Utilities for helping to migrate to stricter
5
+ and more consistent use of IDs and types.
6
+
7
+ @module
8
+ */
9
+
10
+ let MismatchReporter = function () {};
11
+
12
+ // TODO: @runspired This pattern prevents AssertFn from being removed in production builds
13
+ // but we should enable that if we can.
14
+ let _AssertFn = function () {};
15
+ const AssertFn = (message, condition) => {
16
+ if (!condition) {
17
+ _AssertFn(message, condition);
18
+ }
19
+ (test => {
20
+ if (!test) {
21
+ throw new Error(message);
22
+ }
23
+ })(condition);
24
+ };
25
+ let NormalizedType = str => {
26
+ return singularize(dasherize(str));
27
+ };
28
+
29
+ /**
30
+ * Configure a function to be called when an id or type
31
+ * changes during normalization. This is useful for instrumenting
32
+ * to discover places where usage in the app is not consistent.
33
+ *
34
+ * @param fn - a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value
35
+ * @public
36
+ */
37
+ function configureMismatchReporter(fn) {
38
+ MismatchReporter = fn;
39
+ }
40
+
41
+ /**
42
+ * Configure a function to be called when an id or type
43
+ * fails validation. This is useful for instrumenting
44
+ * to discover places where usage in the app is not consistent.
45
+ *
46
+ * @param fn - a function which takes a message and a condition
47
+ * @public
48
+ */
49
+ function configureAssertFn(fn) {
50
+ _AssertFn = fn;
51
+ }
52
+
53
+ /**
54
+ * Configure a function to be called to normalize
55
+ * a resource type string. Used by both formattedType
56
+ * and isEquivType to ensure consistent normalization
57
+ * during comparison.
58
+ *
59
+ * If validation fails or the type turns out be unnormalized
60
+ * the configured mismatch reporter and assert functions will
61
+ * be called.
62
+ *
63
+ * @param fn - a function which takes a string and returns a string
64
+ * @public
65
+ */
66
+ function configureTypeNormalization(fn) {
67
+ NormalizedType = fn;
68
+ }
69
+ const NORMALIZED_TYPES = new Map();
70
+
71
+ /**
72
+ * Converts a potentially unnormalized type into the format expected
73
+ * by our WarpDrive Cache. Currently this is singular-dasherized.
74
+ *
75
+ * you should not rely on this function to give you an exact format
76
+ * for display purposes. Formatting for display should be handled
77
+ * differently if the exact format matters.
78
+ *
79
+ * Asserts invalid types (undefined, null, '') in dev.
80
+ *
81
+ * **Usage**
82
+ *
83
+ * ```js
84
+ * import formattedType from 'soxhub-client/helpers/formatted-type';
85
+ *
86
+ * formattedType('post'); // => 'post'
87
+ * formattedType('posts'); // => 'post'
88
+ * formattedType('Posts'); // => 'post'
89
+ * formattedType('post-comment'); // => 'post-comment'
90
+ * formattedType('post-comments'); // => 'post-comment'
91
+ * formattedType('post_comment'); // => 'post-comment'
92
+ * formattedType('postComment'); // => 'post-comment'
93
+ * formattedType('PostComment'); // => 'post-comment'
94
+ * ```
95
+ *
96
+ * @param type the potentially un-normalized type
97
+ * @return the normalized type
98
+ * @public
99
+ */
100
+ function formattedType(type) {
101
+ AssertFn('formattedType: type must not be null', type !== null);
102
+ AssertFn('formattedType: type must not be undefined', type !== undefined);
103
+ AssertFn('formattedType: type must be a string', typeof type === 'string');
104
+ AssertFn('formattedType: type must not be empty', type.length > 0);
105
+ let normalized = NORMALIZED_TYPES.get(type);
106
+ if (normalized === undefined) {
107
+ normalized = NormalizedType(type);
108
+ NORMALIZED_TYPES.set(type, normalized);
109
+ }
110
+ if (normalized !== type) {
111
+ MismatchReporter('formatted-type', type, normalized);
112
+ }
113
+ return normalized;
114
+ }
115
+
116
+ /**
117
+ * Format an id to the format expected by the WarpDrive Cache.
118
+ * Currently this means that id should be `string | null`.
119
+ *
120
+ * Asserts invalid IDs (undefined, '', 0, '0') in dev.
121
+ *
122
+ * **Usage**
123
+ *
124
+ * ```js
125
+ * import formattedId from 'client/utils/formatted-id';
126
+ *
127
+ * formattedId('1'); // => '1'
128
+ * formattedId(1); // => '1'
129
+ * formattedId(null); // => null
130
+ * ```
131
+ *
132
+ * @param id the potentially un-normalized id
133
+ * @return the normalized id
134
+ * @public
135
+ */
136
+
137
+ function formattedId(id) {
138
+ AssertFn('formattedId: id must not be undefined', id !== undefined);
139
+ AssertFn('formattedId: id must be a number, string or null', typeof id === 'number' || typeof id === 'string' || id === null);
140
+ AssertFn('formattedId: id must not be empty', typeof id === 'number' || id === null || typeof id === 'string' && id.length > 0);
141
+ AssertFn('formattedId: id must not be 0', id !== '0' && id !== 0);
142
+ const formatted = id === null ? null : String(id);
143
+ if (formatted !== id) {
144
+ MismatchReporter('formatted-id', id, formatted);
145
+ }
146
+ return id === null ? null : String(id);
147
+ }
148
+ function expectId(id) {
149
+ AssertFn('expectId: id must not be null', id !== null);
150
+ return formattedId(id);
151
+ }
152
+
153
+ /**
154
+ * Compares two types for strict equality, converting them to
155
+ * the format expected by the WarpDrive Cache to ensure
156
+ * differences in format are accounted for in the comparison.
157
+ *
158
+ * Asserts when expected or actual are invalid types in dev.
159
+ * Expected may never be null.
160
+ *
161
+ * ```js
162
+ * isEquivType('posts', 'post'); // true
163
+ * isEquivType('post', 'post'); // true
164
+ * isEquivType('posts', 'posts'); // true
165
+ * isEquivType('post-comment', 'postComment'); // true
166
+ * isEquivType('post-comment', 'PostComment'); // true
167
+ * isEquivType('post-comment', 'post_comment'); // true
168
+ * isEquivType('post-comment', 'post-comment'); // true
169
+ * isEquivType('post-comment', 'post'); // false
170
+ * isEquivType('posts', null); // false
171
+ * ```
172
+ *
173
+ * @param expected a potentially unnormalized type to match against
174
+ * @param actual a potentially unnormalized type to match against
175
+ * @return true if the types are equivalent
176
+ * @public
177
+ */
178
+ function isEquivType(expected, actual) {
179
+ AssertFn('isEquivType: Expected type must not be null', expected !== null);
180
+ AssertFn('isEquivType: Expected type must not be undefined', expected !== undefined);
181
+ AssertFn('isEquivType: Expected type must be a string', typeof expected === 'string');
182
+ AssertFn('isEquivType: Expected type must not be empty', expected.length > 0);
183
+ AssertFn('isEquivType: Actual type must not be null', actual !== null);
184
+ AssertFn('isEquivType: Actual type must not be undefined', actual !== undefined);
185
+ AssertFn('isEquivType: Actual type must be a string', typeof actual === 'string');
186
+ AssertFn('isEquivType: Actual type must not be empty', actual.length > 0);
187
+ return expected === actual || formattedType(expected) === formattedType(actual);
188
+ }
189
+
190
+ /**
191
+ * Compares two IDs for strict equality, converting them to
192
+ * the format expected by the WarpDrive Cache to ensure
193
+ * differences in format are accounted for in the comparison.
194
+ *
195
+ * Asserts when expected or actual are invalid IDs in dev.
196
+ * Expected may never be null.
197
+ *
198
+ * ```js
199
+ * isEquivId('1', 1); // true
200
+ * isEquivId('2', '2'); // true
201
+ * isEquivId(3, '3'); // true
202
+ * isEquivId(4, '3'); // false
203
+ * isEquivId(1, null); // false
204
+ * ```
205
+ *
206
+ * @param expected a potentially un-normalized id to match against
207
+ * @param actual a potentially un-normalized id to match against
208
+ * @return true if the ids are equivalent
209
+ * @public
210
+ */
211
+ function isEquivId(expected, actual) {
212
+ AssertFn('isEquivId: Expected id must not be null', expected !== null);
213
+ AssertFn('isEquivId: Expected id must not be undefined', expected !== undefined);
214
+ AssertFn('isEquivId: Expected id must be a number or string', typeof expected === 'number' || typeof expected === 'string');
215
+ AssertFn('isEquivId: Expected id must not be empty', typeof expected === 'number' || typeof expected === 'string' && expected.length > 0);
216
+ AssertFn('isEquivId: Expected id must not be 0', expected !== '0' && expected !== 0);
217
+ AssertFn('isEquivId: Actual id must not be undefined', actual !== undefined);
218
+ AssertFn('isEquivId: Actual id must be a number, string or null', typeof actual === 'number' || typeof actual === 'string' || actual === null);
219
+ AssertFn('isEquivId: Actual id must not be empty', actual === null || typeof actual === 'number' || typeof actual === 'string' && actual.length > 0);
220
+ AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);
221
+ return expected === actual || formattedId(expected) === formattedId(actual);
222
+ }
223
+ export { configureAssertFn, configureMismatchReporter, configureTypeNormalization, expectId, formattedId, formattedType, isEquivId, isEquivType };