You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `inflektTree` function recursively transforms all property names in an object tree using any transformer function. This is useful for converting API responses between naming conventions.
The `camelizeArgv` function is a specialized utility for transforming CLI argument objects (typically from minimist or similar parsers) from kebab-case or snake_case to camelCase.
196
-
197
-
### Usage
198
-
199
-
```typescript
200
-
import { camelizeArgv } from'inflekt';
201
-
202
-
// Transform CLI arguments
203
-
const argv = {
204
-
'schema-file': 'test.graphql',
205
-
'dry-run': true,
206
-
output_dir: 'dist',
207
-
_: ['arg1', 'arg2']
208
-
};
209
-
210
-
const parsedArgv =camelizeArgv(argv);
211
-
// Result:
212
-
// {
213
-
// schemaFile: 'test.graphql',
214
-
// dryRun: true,
215
-
// outputDir: 'dist',
216
-
// _: ['arg1', 'arg2']
217
-
// }
218
-
```
219
-
220
-
### Features
221
-
222
-
- Transforms kebab-case and snake_case keys to camelCase
223
-
- Only transforms top-level keys (preserves nested object structure)
224
-
- Preserves minimist internal keys (`_` and keys starting with `_`)
225
-
- Built on top of `inflektTree` for consistency
226
-
227
183
## Latin Suffix Overrides
228
184
229
185
This library handles Latin plural suffixes differently than the standard `inflection` package to match PostGraphile's behavior:
0 commit comments