summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/decamelize-keys/index.js
blob: f731ca0a6f7406fa0c9428d47ae6d4c76dfa515d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';
var mapObj = require('map-obj');
var decamelize = require('decamelize');

module.exports = function (input, separator, options) {
	if (typeof separator !== 'string') {
		options = separator;
		separator = null;
	}

	options = options || {};
	separator = separator || options.separator;
	var exclude = options.exclude || [];

	return mapObj(input, function (key, val) {
		key = exclude.indexOf(key) === -1 ? decamelize(key, separator) : key;
		return [key, val];
	});
};