We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18e267c commit 4656109Copy full SHA for 4656109
test/types/community/collection/recursive-types.test-d.ts
@@ -228,3 +228,37 @@ recursiveSchemaWithArray.findOne({
228
name: 3
229
}
230
});
231
+
232
+// Modeling A -> B -> C -> D -> A recursive type
233
+type A = {
234
+ name: string;
235
+ b: B;
236
+};
237
238
+type B = {
239
240
+ c: C;
241
242
243
+type C = {
244
245
+ d: D;
246
247
248
+type D = {
249
250
+ a: A;
251
252
253
+expectAssignable<Filter<A>>({
254
+ 'b.c.d.a.b.c.d.a.b.name': 'a'
255
+});
256
257
+expectNotAssignable<Filter<A>>({
258
+ 'b.c.d.a.b.c.d.a.b.name': 2
259
260
261
+// why does this blow up
262
+expectAssignable<UpdateFilter<A>>({
263
+ $set: { 'b.c.d.a.b.c.d.a.b.c.name': 'a' }
264
0 commit comments