@player-tools/xlr-sdk 0.13.0-next.3 → 0.13.0-next.5

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.
@@ -1,5 +1,10 @@
1
1
  import { test, expect, describe } from "vitest";
2
- import type { NamedType, TransformFunction, OrType } from "@player-tools/xlr";
2
+ import type {
3
+ NamedType,
4
+ TransformFunction,
5
+ OrType,
6
+ ObjectType,
7
+ } from "@player-tools/xlr";
3
8
  import { parseTree } from "jsonc-parser";
4
9
  import {
5
10
  Types,
@@ -70,9 +75,21 @@ describe("Object Recall", () => {
70
75
  const sdk = new XLRSDK();
71
76
  sdk.loadDefinitionsFromModule(Types);
72
77
  sdk.loadDefinitionsFromModule(ReferenceAssetsWebPluginManifest);
73
-
74
78
  expect(sdk.getType("InputAsset")).toMatchSnapshot();
75
79
  });
80
+
81
+ test("Test Correct Generic Cascading", () => {
82
+ const sdk = new XLRSDK();
83
+ sdk.loadDefinitionsFromModule(Types);
84
+ sdk.loadDefinitionsFromModule(ReferenceAssetsWebPluginManifest);
85
+ const Flow = sdk.getType("Flow") as ObjectType;
86
+ const Schema = Flow.properties["schema"].node as ObjectType;
87
+ const Node = Schema.additionalProperties as ObjectType;
88
+ const DataTypes = Node.additionalProperties as OrType;
89
+ const DataType = DataTypes.or[0] as ObjectType;
90
+ const df = DataType.properties["default"].node;
91
+ expect(df.type).toBe("unknown");
92
+ });
76
93
  });
77
94
 
78
95
  describe("Validation", () => {
package/src/sdk.ts CHANGED
@@ -311,7 +311,7 @@ export class XLRSDK {
311
311
  * - filing in any remaining generics with their default value
312
312
  */
313
313
  private resolveType(type: NamedType, optimize = true): NamedType {
314
- const resolvedObject = fillInGenerics(type);
314
+ const resolvedObject = fillInGenerics(type, new Map(), true);
315
315
 
316
316
  let transformMap: TransformFunctionMap = {
317
317
  object: [(objectNode: ObjectType) => {
File without changes