UNPKG

@dillonkearns/elm-graphql

Version:

<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">

20 lines (16 loc) 484 B
'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]; }); };