Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@albertoarana/encoder-parameters

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@albertoarana/encoder-parameters

A encoder parameters function to transform data in params format

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

#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);
// ouput: ?name=Alberto&lastname=Arana

With serialize

import encoderParameters from '@albertoarana/encoder-parameters';

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

const params = {
  name: 'Alberto',
  lastname: 'Arana'
};

encoderParameters(params, serialize);
// ouput: ?filterName=Alberto&filterLastName=Arana

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()]
}

FAQs

Package last updated on 25 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc