object-key-casing
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.22latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.22

Package Sidebar

Install

npm i object-key-casing

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

6.14 kB

Total Files

5

Last publish

Collaborators

  • xkore