Socket
Socket
Sign inDemoInstall

uppercase-keys-object

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uppercase-keys-object

Uppercase the keys of an object


Version published
Weekly downloads
23
increased by130%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

uppercase-keys-object

NPM version NPM downloads

Uppercase the keys of an object. Use for node and browser

It is useful for oracledb.

Installation

$ npm install --save uppercase-keys-object

or

$ yarn add uppercase-keys-object

Usage

Node.JS
const upperKeys = require('uppercase-keys-object');

const object = {
	camelCase: 1,
	UPPERCASE: 2,
	lowercase: 3,
	snake_case: 4,
	PascalCase: 5,
	'Title Case': 6,
	'dot.case': 7,
	'param-case': 8,
	'Sentence case': 9,
	'path/case': 10,
	'Header-Case': 11
};

const res = upperKeys(object);

console.log(res);
/**
{ CAMELCASE: 1,
  UPPERCASE: 2,
  LOWERCASE: 3,
  SNAKE_CASE: 4,
  PASCALCASE: 5,
  'TITLE CASE': 6,
  'DOT.CASE': 7,
  'PARAM-CASE': 8,
  'SENTENCE CASE': 9,
  'PATH/CASE': 10,
  'HEADER-CASE': 11 }
 */

console.log(upperKeys(null)); // null
console.log(upperKeys(undefined)); // null
Browser
1. NPM Package
<script src="./node_modules/uppercase-keys-object/dist/uppercase-keys-object.js"></script>
<!-- Or use minified -->
<script src="./node_modules/uppercase-keys-object/dist/uppercase-keys-object.min.js"></script>
2. Download from source
<script src="path/to/uppercase-keys-object"></script>
Usage
<script>
	
	const object = {
		camelCase: 1,
		UPPERCASE: 2,
		lowercase: 3,
		snake_case: 4,
		PascalCase: 5,
		'Title Case': 6,
		'dot.case': 7,
		'param-case': 8,
		'Sentence case': 9,
		'path/case': 10,
		'Header-Case': 11
	};

	const res = upperKeys(object);

	console.log(res);
	console.log(upperKeys(null)); // null
	console.log(upperKeys(undefined)); // null

</script>

API

upperKeys(object)

Returns a new object which keys is/are uppercased.

Keywords

FAQs

Last updated on 05 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc