Socket
Socket
Sign inDemoInstall

type-fest

Package Overview
Dependencies
0
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.10.1 to 4.10.2

2

package.json
{
"name": "type-fest",
"version": "4.10.1",
"version": "4.10.2",
"description": "A collection of essential TypeScript types",

@@ -5,0 +5,0 @@ "license": "(MIT OR CC0-1.0)",

@@ -66,2 +66,5 @@ import type {ConditionalSimplifyDeep} from './conditional-simplify';

// Helper to avoid computing ArrayTail twice.
type PickRestTypeHelper<Tail extends UnknownArrayOrTuple, Type> = Tail extends [] ? Type : PickRestType<Tail>;
/**

@@ -80,5 +83,14 @@ Pick the rest type.

type PickRestType<Type extends UnknownArrayOrTuple> = number extends Type['length']
? ArrayTail<Type> extends [] ? Type : PickRestType<ArrayTail<Type>>
? PickRestTypeHelper<ArrayTail<Type>, Type>
: [];
// Helper to avoid computing ArrayTail twice.
type OmitRestTypeHelper<
Tail extends UnknownArrayOrTuple,
Type extends UnknownArrayOrTuple,
Result extends UnknownArrayOrTuple = [],
> = Tail extends []
? Result
: OmitRestType<Tail, [...Result, FirstArrayElement<Type>]>;
/**

@@ -98,3 +110,3 @@ Omit the rest type.

type OmitRestType<Type extends UnknownArrayOrTuple, Result extends UnknownArrayOrTuple = []> = number extends Type['length']
? ArrayTail<Type> extends [] ? Result : OmitRestType<ArrayTail<Type>, [...Result, FirstArrayElement<Type>]>
? OmitRestTypeHelper<ArrayTail<Type>, Type, Result>
: Type;

@@ -101,0 +113,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc