0.0.2 • Published 9 months ago

object-key-casing v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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' }