Skip to content

Commit c1c4c70

Browse files
author
John Kleinschmidt
authored
Merge pull request #156 from nornagon/patch-1
fix: recognize typed arrays as builtins
2 parents 3a436a6 + 78a7816 commit c1c4c70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ export const isPrimitive = (type: string) => {
270270
return primitives.indexOf(type.toLowerCase().replace(/\[\]/g, '')) !== -1;
271271
};
272272
export const isBuiltIn = (type: string) => {
273-
const builtIns = ['promise', 'buffer'];
273+
const builtIns = ['promise', 'buffer', 'Int8Array', 'Uint8Array',
274+
'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array',
275+
'Uint32Array', 'Float32Array', 'Float64Array', 'BigInt64Array',
276+
'BigUint64Array'];
274277
return builtIns.indexOf(type.toLowerCase().replace(/\[\]/g, '')) !== -1;
275278
};
276279
export const isOptional = (param: { required?: boolean; name: string; type: any }) => {

0 commit comments

Comments
 (0)