Socket
Socket
Sign inDemoInstall

ts-pattern

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-pattern - npm Package Compare versions

Comparing version 3.1.3 to 3.2.1-next.0

2

lib/index.d.ts
import type { Pattern, AnonymousSelectPattern, NamedSelectPattern, GuardPattern, NotPattern, GuardFunction } from './types/Pattern';
import type { Match } from './types/Match';
import { __ } from './PatternType';
import { AnyConstructor } from './types/helpers';
export declare const when: <a, b extends a = never>(predicate: GuardFunction<a, b>) => GuardPattern<a, b>;

@@ -8,2 +9,3 @@ export declare const not: <a>(pattern: Pattern<a>) => NotPattern<a>;

export declare function select<k extends string>(key: k): NamedSelectPattern<k>;
export declare function instanceOf<T extends AnyConstructor>(classConstructor: T): GuardPattern<unknown, InstanceType<T>>;
/**

@@ -10,0 +12,0 @@ * # Pattern matching

@@ -24,3 +24,3 @@ "use strict";

exports.__esModule = true;
exports.match = exports.__ = exports.select = exports.not = exports.when = void 0;
exports.match = exports.__ = exports.instanceOf = exports.select = exports.not = exports.when = void 0;
var PatternType_1 = require("./PatternType");

@@ -49,2 +49,6 @@ exports.__ = PatternType_1.__;

exports.select = select;
function instanceOf(classConstructor) {
return exports.when(function (val) { return val instanceof classConstructor; });
}
exports.instanceOf = instanceOf;
/**

@@ -51,0 +55,0 @@ * #### match

@@ -50,2 +50,3 @@ export declare type ValueOf<a> = a extends any[] ? a[number] : a[keyof a];

export declare type Union<a, b> = [b] extends [a] ? a : [a] extends [b] ? b : a | b;
export declare type AnyConstructor = new (...args: any[]) => any;
export {};

2

package.json
{
"name": "ts-pattern",
"version": "3.1.3",
"version": "3.2.1-next.0",
"description": "Typescript pattern matching library",

@@ -5,0 +5,0 @@ "main": "lib/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