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

@ts-common/json

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-common/json - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

index.d.ts

@@ -6,3 +6,3 @@ export interface ObjectProperties {

export declare type ArrayObject = Array<any>;
export declare type Json = null | boolean | string | number | Object | ArrayObject;
export declare type Json = null | boolean | string | number | ArrayObject | Object;
export interface Visitor<T> {

@@ -13,4 +13,4 @@ asNull(): T;

asNumber(value: number): T;
asArray(value: ReadonlyArray<Json>): T;
asObject(value: ObjectProperties): T;
asArray(value: ReadonlyArray<Json>): T;
}

@@ -17,0 +17,0 @@ export declare function visit<T>(value: Json, visitor: Visitor<T>): T;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function visit(value, visitor) {
if (value === null) {
return visitor.asNull();
}
if (typeof value === "boolean") {
return visitor.asBoolean(value);
}
if (typeof value === "string") {
return visitor.asString(value);
}
if (typeof value === "number") {
return visitor.asNumber(value);
}
if (value instanceof Array) {
return visitor.asArray(value);
}
return visitor.asObject(value);
return value === null ? visitor.asNull() :
typeof value === "boolean" ? visitor.asBoolean(value) :
typeof value === "string" ? visitor.asString(value) :
typeof value === "number" ? visitor.asNumber(value) :
value instanceof Array ? visitor.asArray(value) :
visitor.asObject(value);
}

@@ -21,0 +11,0 @@ exports.visit = visit;

{
"name": "@ts-common/json",
"version": "0.0.2",
"version": "0.0.3",
"description": "JSON Data Type",

@@ -5,0 +5,0 @@ "main": "index.js",

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