persona-community-5/.pnpm-store/v3/files/c1/cb3c069557dd11881f839d6193f68b2892d13fb3725f41fd86b85933bb4ed29258ca215525ce7a968f1cdab5595b78cc1f27f06fc02230516b259afd06a336
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

41 lines
1.0 KiB
Plaintext

import type {DefaultDelimiterCaseOptions} from './delimiter-case';
import type {DelimiterCasedProperties} from './delimiter-cased-properties';
import type {ApplyDefaultOptions} from './internal';
import type {WordsOptions} from './words';
/**
Convert object properties to snake case but not recursively.
This can be useful when, for example, converting some API types from a different style.
@see SnakeCase
@see SnakeCasedPropertiesDeep
@example
```
import type {SnakeCasedProperties} from 'type-fest';
interface User {
userId: number;
userName: string;
}
const result: SnakeCasedProperties<User> = {
user_id: 1,
user_name: 'Tom',
};
const splitOnNumbers: SnakeCasedProperties<{line1: string}, {splitOnNumbers: true}> = {
'line_1': 'string',
};
```
@category Change case
@category Template literal
@category Object
*/
export type SnakeCasedProperties<
Value,
Options extends WordsOptions = {},
> = DelimiterCasedProperties<Value, '_', ApplyDefaultOptions<WordsOptions, DefaultDelimiterCaseOptions, Options>>;