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

@alloc/types

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alloc/types - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

16

index.d.ts
/** Try to simplify `&` out of an object type */
export type Remap<T> = {} & {
[P in keyof T]: T[P]
[P in keyof Extract<T, object>]: Extract<T, object>[P]
}
export type LoosePick<T, K> = {} & {
[P in K & keyof T]: T[P]
}
export type Pick<T, K extends keyof T> = {} & {

@@ -61,2 +65,4 @@ [P in K]: T[P]

export type StringKeys<T> = string & keyof T
/** Get the keys of each object type in a given union */

@@ -85,7 +91,7 @@ export type AllKeys<T> = T extends any ? keyof T : never

export type Exclusive<T> = keyof T extends infer Keys
? Keys extends infer Key
export type Exclusive<T> = AllKeys<T> extends infer K
? T extends any
? Remap<
{ [P in Extract<keyof T, Key>]: T[P] } &
{ [P in Exclude<keyof T, Key>]?: undefined }
{ [P in Extract<keyof T, K>]: T[P] } &
{ [P in Exclude<K & keyof any, keyof T>]?: undefined }
>

@@ -92,0 +98,0 @@ : never

{
"name": "@alloc/types",
"version": "2.2.0",
"version": "2.2.1",
"types": "index.d.ts",

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

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