| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | var mapObj = require('map-obj'); | ||||
| 3 | var camelCase = require('camelcase'); | ||||
| 4 | |||||
| 5 | module.exports = function (input, options) { | ||||
| 6 | options = options || {}; | ||||
| 7 | var exclude = options.exclude || []; | ||||
| 8 | return mapObj(input, function (key, val) { | ||||
| 9 | key = exclude.indexOf(key) === -1 ? camelCase(key) : key; | ||||
| 10 | return [key, val]; | ||||
| 11 | }); | ||||
| 12 | }; | ||||