Pascalcase the keys of an object. Use for node.js and browser
It is useful for oracledb.
$ npm install --save pascalcase-keys-object
or
$ yarn add pascalcase-keys-object
const pascalKeys = require('pascalcase-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 = pascalKeys(object);
console.log(res);
/**
{ CamelCase: 1,
Uppercase: 2,
Lowercase: 3,
SnakeCase: 4,
PascalCase: 5,
TitleCase: 6,
DotCase: 7,
ParamCase: 8,
SentenceCase: 9,
PathCase: 10,
HeaderCase: 11 }
*/
console.log(pascalKeys(null)); // null
console.log(pascalKeys(undefined)); // null
<script src="./node_modules/pascalcase-keys-object/dist/pascalcase-keys-object.js"></script>
<!-- Or use minified-->
<script src="./node_modules/pascalcase-keys-object/dist/pascalcase-keys-object.min.js"></script>
<script src="path/to/pascalcase-keys-object"></script>
<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 = pascalKeys(object);
console.log(res);
console.log(pascalKeys(null)); // null
console.log(pascalKeys(undefined)); // null
</script>
Returns a new object which keys is/are pascalcased.