File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,7 @@ function stripeTypeScriptInternalTypesSchema (type: any): any {
240240 if ( ! type ) {
241241 return type
242242 }
243+
243244 if ( type . declarations && type . declarations . find ( ( d : any ) => d . file . includes ( 'node_modules/typescript' ) ) ) {
244245 return false
245246 }
@@ -248,28 +249,17 @@ function stripeTypeScriptInternalTypesSchema (type: any): any {
248249 return type . map ( ( sch : any ) => stripeTypeScriptInternalTypesSchema ( sch ) ) . filter ( r => r !== false )
249250 }
250251
251- if ( ! type . schema ) {
252- return type
253- }
254-
255- if ( type . schema . schema ) {
256- const res = stripeTypeScriptInternalTypesSchema ( type . schema )
252+ if ( Array . isArray ( type . schema ) ) {
257253 return {
258254 ...type ,
259- schema : res
255+ schema : type . schema . map ( ( sch : any ) => stripeTypeScriptInternalTypesSchema ( sch ) ) . filter ( ( r : any ) => r !== false )
260256 }
261257 }
262258
263- if ( typeof type . schema !== 'object' ) {
259+ if ( ! type . schema || typeof type . schema !== 'object' ) {
264260 return type
265261 }
266262
267- if ( Array . isArray ( type . schema ) ) {
268- return type . schema
269- . map ( ( sch : any ) => stripeTypeScriptInternalTypesSchema ( sch ) )
270- . filter ( ( r : any ) => r !== false )
271- }
272-
273263 const schema : any = { }
274264 Object . keys ( type . schema ) . forEach ( ( sch ) => {
275265 const res = stripeTypeScriptInternalTypesSchema ( type . schema [ sch ] )
You can’t perform that action at this time.
0 commit comments