Skip to content

Commit 78a7816

Browse files
authored
fix: recognize typed arrays as builtins
1 parent 3a436a6 commit 78a7816

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.ts

Lines changed: 4 additions & 1 deletion
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)