type-crafter 0.9.0 → 0.9.1
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
|
@@ -20513,7 +20513,7 @@ async function runner(language, inputFilePath, outputDirectory, _typesWriterMode
|
|
|
20513
20513
|
}
|
|
20514
20514
|
}
|
|
20515
20515
|
greeting();
|
|
20516
|
-
const program = new Command().version('0.9.
|
|
20516
|
+
const program = new Command().version('0.9.1');
|
|
20517
20517
|
program
|
|
20518
20518
|
.command('generate')
|
|
20519
20519
|
.description('Generate types for your language from a type spec file')
|
|
@@ -21,3 +21,14 @@ export function decode{{typeName}}(rawInput: unknown): {{typeName}} | null {
|
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export function _decode{{typeName}}(rawInput: unknown): {{typeName}} | null {
|
|
27
|
+
switch (rawInput) {
|
|
28
|
+
{{#each values}}
|
|
29
|
+
case {{#if (eq ../type 'string') }}'{{/if}}{{this}}{{#if (eq ../type 'string')}}'{{/if}}:
|
|
30
|
+
{{/each}}
|
|
31
|
+
return rawInput;
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|