obj-query

Convert a single-level nested object to a querystring compatible representation

Usage no npm install needed!

<script type="module">
  import objQuery from 'https://cdn.skypack.dev/obj-query';
</script>

README

obj-query Build Status

Convert a single-level nested object to a querystring compatible representation

Install

$ npm install --save obj-query

Usage

var query = require('obj-query')

query({foo: 1, bar: {baz: 2}})
//=> {foo: 1, 'bar[baz]': 2}

API

query(obj) -> object

obj

Required
Type: object

An object to flatten (one level) into a querystring compatible format.

License

MIT © Ben Drucker