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

@anzenjs/json

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

@anzenjs/json - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4-0.0.4-alpha.2.0

6

cjs/src/codec.d.ts

@@ -1,7 +0,7 @@

import { Schema } from '@anzenjs/core';
import { SchemaLike } from '@anzenjs/core';
import { ICodec } from '@anzenjs/extra';
import { JsonValue } from './types';
export declare class JsonCodec implements ICodec<JsonValue, JsonValue> {
encode(schema: Schema): (value: unknown) => JsonValue;
decode(schema: Schema): (value: JsonValue) => any;
encode(schemaLike: SchemaLike): (value: unknown) => JsonValue;
decode(schemaLike: SchemaLike): (value: JsonValue) => any;
private encodeObject;

@@ -8,0 +8,0 @@ private decodeObject;

@@ -6,3 +6,4 @@ "use strict";

class JsonCodec {
encode(schema) {
encode(schemaLike) {
const schema = core_1.resolveSchema(schemaLike);
return (value) => {

@@ -31,3 +32,4 @@ switch (schema.type) {

}
decode(schema) {
decode(schemaLike) {
const schema = core_1.resolveSchema(schemaLike);
return (value) => {

@@ -34,0 +36,0 @@ switch (schema.type) {

{
"name": "@anzenjs/json",
"version": "0.0.3",
"version": "0.0.4-0.0.4-alpha.2.0",
"main": "dist/src/index.js",

@@ -18,3 +18,3 @@ "types": "dist/src/index.d.ts",

},
"gitHead": "d30d062cf97b6d41cbe401b886aca6106111600e"
"gitHead": "2737e87c8a7c778de9c4adc7c705c6aa9cbec6c5"
}

@@ -7,3 +7,5 @@ import {

Resolve,
resolveSchema,
Schema,
SchemaLike,
SchemaType,

@@ -16,3 +18,5 @@ } from '@anzenjs/core'

export class JsonCodec implements ICodec<JsonValue, JsonValue> {
public encode(schema: Schema) {
public encode(schemaLike: SchemaLike) {
const schema = resolveSchema(schemaLike)
return (value: Resolve<Schema>): JsonValue => {

@@ -53,3 +57,5 @@ switch (schema.type) {

public decode(schema: Schema) {
public decode(schemaLike: SchemaLike) {
const schema = resolveSchema(schemaLike)
return (value: JsonValue): any => {

@@ -56,0 +62,0 @@ switch (schema.type) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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