Socket
Book a DemoInstallSign in
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
Package was removed
Sorry, it seems this package was removed from the registry

@mellkam/json

Typesafe json utility

0.2.1
unpublished
latest
Source
npmnpm
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

json

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.