Skip to content

aaranadev/decoder-parameters

Repository files navigation

Decoder Parameters

Installation

If you are using yarn

yarn add @albertoarana/decoder-parameters

or npm

npm install @albertoarana/decoder-parameters --save

Use

Without serialize

import decoderParameters from '@albertoarana/decoder-parameters';

const params = '?name=Alberto&lastName=Arana';

decoderParameters(params);
// ouput: {name: 'Alberto', lastName: 'Arana'}

With serialize

import decoderParameters from '@albertoarana/decoder-parameters';

const serialize = {
  filterName: 'name',
  filterLastName: 'lastName'
};

const params = '?filterName=Alberto&FilterLastName=Arana';

decoderParameters(params, serialize);
// ouput: {name: 'Alberto', lastname: 'Arana'}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published