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

ts-toolbelt

Package Overview
Dependencies
Maintainers
1
Versions
916
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-toolbelt - npm Package Compare versions

Comparing version 9.5.3-test.1614727682067 to 9.5.3-test.1614866301683

5

out/Any/If.d.ts
import { Boolean } from '../Boolean/_Internal';
export declare type If<B extends Boolean, Then, Else = never> = {
0: Else;
1: Then;
}[B];
export declare type If<B extends Boolean, Then, Else = never> = B extends 1 ? Then : Else;

2

out/Function/_Internal.d.ts

@@ -16,2 +16,2 @@ /**

*/
export declare type Narrowable = string | number | bigint | boolean;
export declare type Narrowable = string | number | bigint | boolean | [];

@@ -1,16 +0,11 @@

import { Cast } from '../Any/Cast';
import { Extends } from '../Any/Extends';
import { If } from '../Any/If';
import { Narrowable } from './_Internal';
/**
* Basic type helper
* @hidden
*/
declare type NarrowRaw<A> = [] | (A extends Narrowable ? A : never) | ({
declare type NarrowRaw<A> = (A extends Narrowable ? A : never) | ({
[K in keyof A]: NarrowRaw<A[K]>;
});
/**
* Enforce proper variance
* @hidden
*/
declare type NarrowVar<A, N = NarrowRaw<A>> = N | Cast<A, N>;
/**
* Prevent type widening on generic function parameters

@@ -23,3 +18,3 @@ * @param A to narrow

*
* declare function foo<A extends any[]>(x: F.Narrow<A>): A;
* declare function foo<A extends any[]>(x: F.Narrow<A | []>): A;
* declare function bar<A extends object>(x: F.Narrow<A>): A;

@@ -34,3 +29,3 @@ *

*/
declare type Narrow<A extends any> = NarrowVar<A>;
declare type Narrow<A extends any> = NarrowRaw<If<Extends<A, any[]>, A | [], A>>;
export { Narrow };
{
"name": "ts-toolbelt",
"version": "9.5.3-test.1614727682067",
"version": "9.5.3-test.1614866301683",
"description": "TypeScript's largest utility library",

@@ -5,0 +5,0 @@ "keywords": [

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