Skip to content

Commit

Permalink
Update src/utils/common.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Stacey <[email protected]>
  • Loading branch information
jpuri and Gudahtt authored Dec 18, 2024
1 parent d0495dc commit f983124
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @returns Parameter string with array brackets [] removed.
*/
export const stripArrayTypeIfPresent = (typeString: string) => {
if (typeString?.match(/\S\s*\[\]$/u) !== null) {
return typeString.replace(/\s*\[\]$/gu, '').trim();
if (typeString?.match(/\S\[\]$/u) !== null) {
return typeString.replace(/\[\]$/gu, '').trim();
}
return typeString;
};

0 comments on commit f983124

Please sign in to comment.