Skip to content

Commit 33a3603

Browse files
feat: support Partial<T> style types (#149)
1 parent 7ff1d87 commit 33a3603

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils.ts

+5
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ export const typify = (
176176
}
177177
debug(chalk.red('Record with missing inner types, default to any'));
178178
return 'Record<any, any>';
179+
case 'partial':
180+
if (!innerTypes || innerTypes.length !== 1) {
181+
throw new Error('Partial generic type must have exactly one inner type. i.e. Partial<T>');
182+
}
183+
return `Partial<${typify(innerTypes[0])}>`;
179184
case 'url':
180185
return 'string';
181186
case 'touchbaritem':

0 commit comments

Comments
 (0)