#Encoder Parameters
Installation
If you are using yarn
yarn add @albertoarana/encoder-parameters
or npm
npm install @albertoarana/encoder-parameters --save
Use
Without serialize
import encoderParameters from '@albertoarana/encoder-parameters';
const params = {
name: 'Alberto',
lastname: 'Arana'
};
encoderParameters(params);
With serialize
import encoderParameters from '@albertoarana/encoder-parameters';
const serialize = {
name: 'filterName',
lastname: 'filterLastName'
};
const params = {
name: 'Alberto',
lastname: 'Arana'
};
encoderParameters(params, serialize);
Important
Currently Set or Map elements are not supported directly. For use these elements it is necessary transform their values into an array.
const map = new Map();
map.set(1, 1);
map.set(2, 2);
const params = {
map: [...map.values()]
}