Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

uppercase-keys-object

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

uppercase-keys-object

Uppercase the keys of an object

    1.1.4latest

Version published
Maintainers
1
Yearly downloads
5,204
decreased by-55.61%

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

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc