object-key-casing
v0.0.2
Published
Set object keys to be capitalized, uncapitalized, uppercase or lowercase.
Downloads
3
Maintainers
Readme
object-key-casing
Utilities and utility types to capitalize, uppercase, uncapitalize and lowercase object keys.
Utility Examples
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' }
Utility Type Examples
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' }