New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

any2json

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any2json

Converts anything to json object

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

Any Type to JSON Converter

The purpose of this utility is to convert from any type to object without having to worry about exceptions. Here are the cases for different types:

If Object, returns the same. If String, tries to do JSON.parse. If success, returns the object else returns an empty object, If any other type, returns an object with the input stored across the key, which is provided to the method in second parameter. If not provided, defaults to the string 'key'.

declare function any2json(input: any, key = 'value');

Keywords

json

FAQs

Package last updated on 06 Feb 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