/usr/lib/nodejs/camelcase-keys/index.js is in node-camelcase-keys 4.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 'use strict';
const mapObj = require('map-obj');
const camelCase = require('camelcase');
const has = (arr, key) => arr.some(x => typeof x === 'string' ? x === key : x.test(key));
module.exports = (input, opts) => {
opts = Object.assign({
exclude: [],
deep: false
}, opts);
return mapObj(input, (key, val) => {
key = has(opts.exclude, key) ? key : camelCase(key);
return [key, val];
}, {deep: opts.deep});
};
|