blob: f731ca0a6f7406fa0c9428d47ae6d4c76dfa515d [file] [log] [blame]
Mathias Bynens79e2cf02020-05-29 14:46:171'use strict';
2var mapObj = require('map-obj');
3var decamelize = require('decamelize');
4
5module.exports = function (input, separator, options) {
6 if (typeof separator !== 'string') {
7 options = separator;
8 separator = null;
9 }
10
11 options = options || {};
12 separator = separator || options.separator;
13 var exclude = options.exclude || [];
14
15 return mapObj(input, function (key, val) {
16 key = exclude.indexOf(key) === -1 ? decamelize(key, separator) : key;
17 return [key, val];
18 });
19};