uppercase-keys-object
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,4 +0,5 @@ | ||
'use strict'; | ||
function upperKeys(obj) { | ||
module.exports = (obj) => { | ||
if (!obj) return null; | ||
const res = {}; | ||
@@ -10,1 +11,5 @@ for (let key in obj) { | ||
} | ||
if (typeof module !== 'undefined' && module.exports) { | ||
module.exports = upperKeys; | ||
} |
{ | ||
"name": "uppercase-keys-object", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Uppercase the keys of an object", | ||
@@ -26,3 +26,5 @@ "main": "index.js", | ||
"keys", | ||
"key" | ||
"key", | ||
"browser", | ||
"browserify" | ||
], | ||
@@ -29,0 +31,0 @@ "author": { |
# uppercase-keys-object | ||
Uppercase the keys of an object. It is useful for oracledb. | ||
Uppercase the keys of an object. Use for node and browser | ||
It is useful for [oracledb](https://github.com/oracle/node-oracledb). | ||
@@ -16,2 +17,4 @@ ## Installation | ||
#### Node.JS | ||
```js | ||
@@ -32,4 +35,34 @@ const upperKeys = require('uppercase-keys-object'); | ||
// { ID: 127, FIRST_NAME: 'Huynh', LAST_NAME: 'Ha', SALARY: 1500 } | ||
console.log(lowerKeys(null)); // null | ||
console.log(lowerKeys(undefined)); // null | ||
``` | ||
#### Browser | ||
##### 1. NPM Package | ||
```html | ||
<script src="./node_modules/uppercase-keys-object/index.js"></script> | ||
``` | ||
##### 2. Download from source | ||
```html | ||
<script src="path/to/uppercase-keys-object"></script> | ||
``` | ||
##### Usage | ||
```html | ||
<script> | ||
const employee = { | ||
ID: 127, | ||
FIRST_Name: 'Huynh', | ||
last_NAME: 'Ha', | ||
salary: 1500 | ||
}; | ||
const res = upperKeys(employee); | ||
console.log(res); | ||
console.log(upperKeys(null)); // null | ||
console.log(upperKeys(undefined)); // null | ||
</script> | ||
``` | ||
## API | ||
@@ -43,2 +76,2 @@ | ||
## Related | ||
[lowercase-keys-object]() | ||
[uppercase-keys-object](https://github.com/huynhsamha/uppercase-keys-object) |
@@ -13,1 +13,3 @@ const upperKeys = require('./index'); | ||
console.log(res); | ||
console.log(lowerKeys(null)); | ||
console.log(lowerKeys(undefined)); |
2899
22
75