1.0.0 • Published 5 years ago

@videsk/params-parser v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

Params Parser

This library allow to generate a url with params added by object, array or by units.

How to use

For start only need initialize class.

const paramParse = new ParamsParse();

Add params by one

paramParse.add()

Add params by object

paramParse.byObj({ name: 'John', number: 9236376288 });

Add params by array

paramParse.byArray('channels[$in]', ['5c82cb15582685351224cce3', '5c82cb25582685351224cce4'])

Get the URL

For get the URL with parameters only need execute:

paramParse.parse();

// Output
'?name=John&number=9236376288&channels[$in]=5c82cb15582685351224cce3&channels[$in]=5c82cb25582685351224cce4';

Copyrights

This library is totally open source with Apache 2.0 license, but was designed for Videsk™ products.

1.0.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago