Skip to content

Commit 5c598f1

Browse files
thyngsterautofix-ci[bot]antfu
authored
fix(useChangeCase): use the exported key for filter (#4130)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Anthony Fu <[email protected]>
1 parent fd8842b commit 5c598f1

File tree

1 file changed

+4
-3
lines changed
  • packages/integrations/useChangeCase

1 file changed

+4
-3
lines changed

packages/integrations/useChangeCase/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ type ChangeCaseKeys = FilterKeys<typeof changeCase>
1111

1212
export type ChangeCaseType = ChangeCaseKeys[keyof ChangeCaseKeys]
1313

14-
const changeCaseTransforms: any = /* @__PURE__ */ Object.values(changeCase)
15-
.filter(v => typeof v === 'function' && v.name.endsWith('Case')).reduce((acc, fn) => {
16-
acc[fn.name] = fn
14+
const changeCaseTransforms: any = /* @__PURE__ */ Object.entries(changeCase)
15+
.filter(([name, fn]) => typeof fn === 'function' && name.endsWith('Case'))
16+
.reduce((acc, [name, fn]) => {
17+
acc[name] = fn
1718
return acc
1819
}, {} as any)
1920

0 commit comments

Comments
 (0)