Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
decoder.js
encoder.js
index.js
package.json
test.js
yarn.lock

README.md

Encode nested objects into query strings in a readable AND safe format.

Usage

Encoding

const query = {
  a: {
    b: { c: ["good", "best"] },
    b2: "hi"
  },
  page: "10"
};

encode(query);
>>> "a.b.c=good&a.b.c=best&a.b2=hi&page=10"

Decoding

const queryString = "a.b.c=good&a.b.c=best&a.b2=hi&page=10"

decode(queryString)
{
  a: {
    b: { c: ["good", "best"] },
    b2: "hi"
  },
  page: "10"
};
You can’t perform that action at this time.