@golemcloud/golem-ts-typegen 0.0.7 → 0.0.8

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.
package/dist/index.js CHANGED
@@ -137,7 +137,7 @@ export function getFromTsMorph(tsMorphType) {
137
137
  return { kind: "boolean" };
138
138
  }
139
139
  if (type.isLiteral()) {
140
- const literalValue = type.getText();
140
+ const literalValue = type.getLiteralValue()?.toString();
141
141
  return { kind: "literal", name: aliasName, literalValue: literalValue };
142
142
  }
143
143
  if (type.isTuple()) {
package/dist/index.mjs CHANGED
@@ -233187,7 +233187,7 @@ function getFromTsMorph(tsMorphType) {
233187
233187
  return { kind: "boolean" };
233188
233188
  }
233189
233189
  if (type.isLiteral()) {
233190
- const literalValue = type.getText();
233190
+ const literalValue = type.getLiteralValue()?.toString();
233191
233191
  return { kind: "literal", name: aliasName, literalValue: literalValue };
233192
233192
  }
233193
233193
  if (type.isTuple()) {
@@ -35,6 +35,24 @@ export declare class FooBar {
35
35
  value: number;
36
36
  constructor(name: string, value: number);
37
37
  }
38
+ export type EitherX = {
39
+ ok?: string;
40
+ err?: string;
41
+ };
42
+ export type EitherY = {
43
+ tag: "ok";
44
+ val: string;
45
+ } | {
46
+ tag: "err";
47
+ val: string;
48
+ };
49
+ export type EitherZ = {
50
+ tag: "ok";
51
+ val: string;
52
+ } | {
53
+ tag: "err";
54
+ val?: string;
55
+ };
38
56
  export interface TestInterfaceType {
39
57
  numberProp: number;
40
58
  stringProp: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@golemcloud/golem-ts-typegen",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "tag": "test"
@@ -64,7 +64,7 @@
64
64
  "commander": "^14.0.0",
65
65
  "log-symbols": "^7.0.1",
66
66
  "ts-morph": "^26.0.0",
67
- "@golemcloud/golem-ts-types-core": "0.0.7"
67
+ "@golemcloud/golem-ts-types-core": "0.0.8"
68
68
  },
69
69
  "scripts": {
70
70
  "lint": "eslint . --ext .ts,.tsx",