🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

uppercase-keys-object

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uppercase-keys-object

Uppercase the keys of an object

1.1.4
latest
Source
npm
Version published
Maintainers
1
Created
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

uppercase

FAQs

Package last updated on 05 Aug 2018

Did you know?

Socket

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