Skip to content

Commit

Permalink
fix(stripe-types): respect array & non-object types
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jan 17, 2024
1 parent bacda79 commit 22b307b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ function stripeTypeScriptInternalTypesSchema (type: any): any {
}
}

if (typeof type.schema !== 'object') {
return type
}

if (Array.isArray(type.schema)) {
return type.schema
.map((sch: any) => stripeTypeScriptInternalTypesSchema(sch))
.filter((r: any) => r !== false)
}

const schema: any = {}
Object.keys(type.schema).forEach((sch) => {
const res = stripeTypeScriptInternalTypesSchema(type.schema[sch])
Expand Down

0 comments on commit 22b307b

Please sign in to comment.