Utilities and utility types to capitalize, uppercase, uncapitalize and lowercase object keys.
const capitalized = capitalizeKeys({
string: 'test'
});
// { String: 'test' }
const uppercased = uppercaseKeys({
string: 'test'
});
// { STRING: 'test' }
const uncapitalized = uncapitalizeKeys({
String: 'test'
});
// { string: 'test' }
const lowercased = lowercaseKeys({
STRING: 'test'
});
// { string: 'test' }
type Capitalized = CapitalizeKeys<{
string: 'test'
}>;
// { String: 'test' }
type Uppercased = UppercaseKeys<{
string: 'test'
}>;
// { STRING: 'test' }
type Uncapitalized = UncapitalizeKeys<{
String: 'test'
}>;
// { string: 'test' }
type Lowercased = LowercaseKeys<{
STRING: 'test'
}>;
// { string: 'test' }