@twin.org/tools-core 0.0.3-next.16 → 0.0.3-next.17

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.
@@ -112,6 +112,14 @@ export declare class JsonSchemaBuilder {
112
112
  * @returns The mapped schema.
113
113
  */
114
114
  static mapTypeNodeToSchema(context: ITypeScriptToSchemaContext, typeNode: ts.TypeNode): IJsonSchema | undefined;
115
+ /**
116
+ * Determine whether a union of primitive keyword branches is pairwise disjoint.
117
+ * @param unionTypeNode The union node being mapped.
118
+ * @param unionTypeNodes The original union branch type nodes.
119
+ * @param unionSchemas The mapped union branch schemas.
120
+ * @returns True if every branch is a primitive keyword schema and no branches overlap.
121
+ */
122
+ static isDisjointPrimitiveKeywordUnion(unionTypeNode: ts.UnionTypeNode, unionTypeNodes: ts.NodeArray<ts.TypeNode>, unionSchemas: IJsonSchema[]): boolean;
115
123
  /**
116
124
  * Determine whether a union of schemas represents mutually exclusive object branches.
117
125
  * @param context The generation context.
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.17](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.16...tools-core-v0.0.3-next.17) (2026-03-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * improve discriminated unions ([9c36ea7](https://github.com/twinfoundation/tools/commit/9c36ea7283230089ff19085ddc4b4c30a4e3f8a2))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/tools-models bumped from 0.0.3-next.16 to 0.0.3-next.17
16
+
3
17
  ## [0.0.3-next.16](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.15...tools-core-v0.0.3-next.16) (2026-03-19)
4
18
 
5
19
 
@@ -376,6 +376,40 @@ The mapped schema.
376
376
 
377
377
  ***
378
378
 
379
+ ### isDisjointPrimitiveKeywordUnion() {#isdisjointprimitivekeywordunion}
380
+
381
+ > `static` **isDisjointPrimitiveKeywordUnion**(`unionTypeNode`, `unionTypeNodes`, `unionSchemas`): `boolean`
382
+
383
+ Determine whether a union of primitive keyword branches is pairwise disjoint.
384
+
385
+ #### Parameters
386
+
387
+ ##### unionTypeNode
388
+
389
+ `UnionTypeNode`
390
+
391
+ The union node being mapped.
392
+
393
+ ##### unionTypeNodes
394
+
395
+ `NodeArray`\<`TypeNode`\>
396
+
397
+ The original union branch type nodes.
398
+
399
+ ##### unionSchemas
400
+
401
+ `IJsonSchema`[]
402
+
403
+ The mapped union branch schemas.
404
+
405
+ #### Returns
406
+
407
+ `boolean`
408
+
409
+ True if every branch is a primitive keyword schema and no branches overlap.
410
+
411
+ ***
412
+
379
413
  ### isNeverDiscriminatedObjectUnion() {#isneverdiscriminatedobjectunion}
380
414
 
381
415
  > `static` **isNeverDiscriminatedObjectUnion**(`context`, `unionTypeNodes`, `unionSchemas`): `boolean`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/tools-core",
3
- "version": "0.0.3-next.16",
3
+ "version": "0.0.3-next.17",
4
4
  "description": "Shared utilities and models for tooling packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
18
  "@twin.org/nameof": "next",
19
- "@twin.org/tools-models": "0.0.3-next.16",
19
+ "@twin.org/tools-models": "0.0.3-next.17",
20
20
  "glob": "13.0.6"
21
21
  },
22
22
  "main": "./dist/es/index.js",