Skip to content

Commit 22b307b

Browse files
committed
fix(stripe-types): respect array & non-object types
1 parent bacda79 commit 22b307b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/parser.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,16 @@ function stripeTypeScriptInternalTypesSchema (type: any): any {
260260
}
261261
}
262262

263+
if (typeof type.schema !== 'object') {
264+
return type
265+
}
266+
267+
if (Array.isArray(type.schema)) {
268+
return type.schema
269+
.map((sch: any) => stripeTypeScriptInternalTypesSchema(sch))
270+
.filter((r: any) => r !== false)
271+
}
272+
263273
const schema: any = {}
264274
Object.keys(type.schema).forEach((sch) => {
265275
const res = stripeTypeScriptInternalTypesSchema(type.schema[sch])

0 commit comments

Comments
 (0)