fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: add null checks for regex match results to satisfy TypeScript strict mode

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+3 -3
+1 -1
packages/openapi-ts-tests/main/test/2.0.x.test.ts
··· 300 300 ); 301 301 // Deduplicate prefixes: Foo_Foo → Foo 302 302 const m = clean.match(/^([A-Za-z\d]+)_\1([A-Za-z\d]*)$/); 303 - if (m) clean = m[1] + m[2]; 303 + if (m?.[1] && m?.[2] !== undefined) clean = m[1] + m[2]; 304 304 return clean; 305 305 }, 306 306 },
+1 -1
packages/openapi-ts-tests/main/test/3.0.x.test.ts
··· 603 603 ); 604 604 // Deduplicate prefixes: Foo_Foo → Foo 605 605 const m = clean.match(/^([A-Za-z\d]+)_\1([A-Za-z\d]*)$/); 606 - if (m) clean = m[1] + m[2]; 606 + if (m?.[1] && m?.[2] !== undefined) clean = m[1] + m[2]; 607 607 return clean; 608 608 }, 609 609 },
+1 -1
packages/openapi-ts-tests/main/test/3.1.x.test.ts
··· 705 705 ); 706 706 // Deduplicate prefixes: Foo_Foo → Foo 707 707 const m = clean.match(/^([A-Za-z\d]+)_\1([A-Za-z\d]*)$/); 708 - if (m) clean = m[1] + m[2]; 708 + if (m?.[1] && m?.[2] !== undefined) clean = m[1] + m[2]; 709 709 return clean; 710 710 }, 711 711 },