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

ts-essentials

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-essentials - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

4

dist/types.d.ts

@@ -31,2 +31,6 @@ /** Essentials */

export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/** Remove keys with `never` value from object type */
export declare type NonNever<T extends {}> = Pick<T, {
[K in keyof T]: T[K] extends never ? never : K;
}[keyof T]>;
/** Merge 2 types, properties types from the latter override the ones defined on the former type */

@@ -33,0 +37,0 @@ export declare type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "2.0.1",
"version": "2.0.2",
"main": "dist/index.js",

@@ -12,0 +12,0 @@ "types": "dist/types.d.ts",

@@ -34,2 +34,3 @@ <p align="center">

- [Omit](#omit)
- [NonNever](#nonnever)
- [Merge](#merge)

@@ -122,2 +123,11 @@ - [UnionToIntersection](#uniontointersection)

### NonNever
Useful for purifying object types. It improves intellisense but also allows for extracting keys satisfying a conditional type.
```typescript
type GetDefined<TypesMap extends { [key: string]: any }> =
keyof NonNever<{ [T in keyof TypesMap]: TypesMap[T] extends undefined ? never : TypesMap[T] }>;
```
### Merge

@@ -124,0 +134,0 @@

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