Skip to content

Commit 961b55c

Browse files
authored
fix(opapi): Casing of types with numbers (#647)
1 parent 7212829 commit 961b55c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

opapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bpinternal/opapi",
3-
"version": "0.15.0",
3+
"version": "0.15.1",
44
"description": "Opapi is a highly opinionated library to generate server, client and documentation from OpenAPI specification using typescript.",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

opapi/src/handler-generator/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function filterObject<K extends string, V>(obj: Record<K, V>, fn: (v: V,
2525
const capitalizeFirstLetter = (text: string) => text.charAt(0).toUpperCase() + text.slice(1).toLowerCase()
2626
const splitHyphens = (tokens: string[]) => tokens.flatMap((token) => token.split('-'))
2727
const splitUnderscores = (tokens: string[]) => tokens.flatMap((token) => token.split('_'))
28-
const splitCaseChange = (tokens: string[]) => tokens.flatMap((token) => token.split(/(?<=[a-z])(?=[A-Z])/))
28+
const splitCaseChange = (tokens: string[]) => tokens.flatMap((token) => token.split(/(?<=[a-z0-9])(?=[A-Z])/))
2929
const splitTokens = (tokens: string[]) =>
3030
[splitHyphens, splitUnderscores, splitCaseChange].reduce((acc, step) => step(acc), tokens)
3131

0 commit comments

Comments
 (0)