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

@mellkam/json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mellkam/json

Typesafe json utility

  • 0.2.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Utility types and validators for typesafe work with json in typescript.

Installation

npm i @mellkam/json

Usage

import { type JSONValue, isJSONValue } from "@mellkam/json";

JSON.parse("...") as JSONValue;
JSON.stringify({ ... } as JSONValue)

isJSONValue({ key: "value" }) // true
isJSONValue({ key: new Map() }) // false

In the case of cyclic objects, the validator gets into an infinite loop.

Validator benchmark

594 times faster than zod json schema

zod: 2.523s
@mellkam/json: 4.244ms

Keywords

FAQs

Package last updated on 16 Apr 2023

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