Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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"
};

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published