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

@contember/typesafe

Package Overview
Dependencies
Maintainers
5
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/typesafe - npm Package Compare versions

Comparing version 1.3.0-alpha.7 to 1.3.0-alpha.8

1

dist/src/index.d.ts

@@ -57,2 +57,3 @@ declare type Unpacked<T> = T extends readonly (infer U)[] ? U : never;

export declare const nullable: <T extends Json>(inner: Type<T>) => Type<T | null>;
export declare const preprocess: <Input extends Json>(inner: Type<Input>, transform: (input: unknown) => unknown) => (input: unknown, path?: PropertyKey[]) => Input;
export declare const transform: <Input extends Json, Result extends Json>(inner: Type<Input>, transform: (value: Input, input: unknown) => Result) => (input: unknown, path?: PropertyKey[]) => Result;

@@ -59,0 +60,0 @@ export declare const coalesce: <T extends Json, F extends Json>(inner: Type<T>, fallback: F) => Type<T | F>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.valueAt = exports.coalesce = exports.transform = exports.nullable = exports.false_ = exports.true_ = exports.null_ = exports.enumeration = exports.intersection = exports.discriminatedTupleUnion = exports.tuple = exports.discriminatedUnion = exports.partiallyDiscriminatedUnion = exports.union = exports.record = exports.noExtraProps = exports.partial = exports.object = exports.array = exports.literal = exports.anyJsonObject = exports.anyJson = exports.scalar = exports.boolean = exports.integer = exports.number = exports.string = exports.fail = exports.ParseError = void 0;
exports.valueAt = exports.coalesce = exports.transform = exports.preprocess = exports.nullable = exports.false_ = exports.true_ = exports.null_ = exports.enumeration = exports.intersection = exports.discriminatedTupleUnion = exports.tuple = exports.discriminatedUnion = exports.partiallyDiscriminatedUnion = exports.union = exports.record = exports.noExtraProps = exports.partial = exports.object = exports.array = exports.literal = exports.anyJsonObject = exports.anyJson = exports.scalar = exports.boolean = exports.integer = exports.number = exports.string = exports.fail = exports.ParseError = void 0;
class ParseError extends Error {

@@ -334,2 +334,6 @@ constructor(path, reason, expected) {

exports.nullable = nullable;
const preprocess = (inner, transform) => (input, path = []) => {
return inner(transform(input), path);
};
exports.preprocess = preprocess;
const transform = (inner, transform) => (input, path = []) => {

@@ -336,0 +340,0 @@ return transform(inner(input, path), input);

2

package.json
{
"name": "@contember/typesafe",
"version": "1.3.0-alpha.7",
"version": "1.3.0-alpha.8",
"license": "Apache-2.0",

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

@@ -380,2 +380,6 @@ type Unpacked<T> = T extends readonly (infer U)[] ? U : never

export const preprocess = <Input extends Json>(inner: Type<Input>, transform: (input: unknown) => unknown) => (input: unknown, path: PropertyKey[] = []): Input => {
return inner(transform(input), path)
}
export const transform = <Input extends Json, Result extends Json>(inner: Type<Input>, transform: (value: Input, input: unknown) => Result) => (input: unknown, path: PropertyKey[] = []): Result => {

@@ -382,0 +386,0 @@ return transform(inner(input, path), input)

Sorry, the diff of this file is not supported yet

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