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

type-plus

Package Overview
Dependencies
Maintainers
1
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

type-plus - npm Package Compare versions

Comparing version 1.23.1 to 1.24.0

10

lib/Partial.d.ts

@@ -1,2 +0,8 @@

export declare type PartialPick<T, U extends keyof T> = Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>>;
export declare type PartialExcept<T, U extends keyof T> = Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>>;
import { Pick } from './pick';
import { UnionKeys } from './UnionKeys';
export declare type PartialPick<T, U extends UnionKeys<T>> = T extends T ? Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>> : never;
/**
* @deprecated replaced by `PartialOmit`
*/
export declare type PartialExcept<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never;
export declare type PartialOmit<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never;

@@ -1,2 +0,8 @@

export declare type PartialPick<T, U extends keyof T> = Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>>;
export declare type PartialExcept<T, U extends keyof T> = Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>>;
import { Pick } from './pick';
import { UnionKeys } from './UnionKeys';
export declare type PartialPick<T, U extends UnionKeys<T>> = T extends T ? Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>> : never;
/**
* @deprecated replaced by `PartialOmit`
*/
export declare type PartialExcept<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never;
export declare type PartialOmit<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never;

2

package.json
{
"name": "type-plus",
"version": "1.23.1",
"version": "1.24.0",
"description": "Provides additional types for `typescript`.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/unional/type-plus",

@@ -63,4 +63,5 @@ # type-plus

- `Omit<T, K>`: From `T`, pick a set of properties whose keys are not in the union `K`. This is the opposite of `Pick<T, K>`.
- `PartialExcept<T, U>`: Deprecated. Same as `PartialOmit<T, U>`.
- `PartialOmit<T, U>`: makes the properties not specified in `U` becomes optional.
- `PartialPick<T, U>`: makes the properties specified in `U` becomes optional.
- `PartialExcept<T, U>`: makes the properties not specified in `U` becomes optional.
- `RecursivePartial<T>`: make type `T` optional recursively.

@@ -67,0 +68,0 @@ - `RecursiveRequired<T>`: make type `T` required recursively.

@@ -1,2 +0,2 @@

import { PartialExcept, PartialPick, typeAssert } from '.';
import { PartialExcept, PartialPick, typeAssert, PartialOmit } from '.';

@@ -17,3 +17,3 @@ test('make picked properties optional', () => {

test('make not picked properties optional', () => {
test('make not specified properties optional', () => {
type Foo = {

@@ -25,2 +25,3 @@ a: number,

// tslint:disable-next-line: deprecation
let y: PartialExcept<Foo, 'a'> = {} as any

@@ -32,1 +33,16 @@

})
test('make not specified properties optional', () => {
type Foo = {
a: number,
b: number,
c: number
}
let y: PartialOmit<Foo, 'a'> = {} as any
typeAssert.noUndefined(y.a)
y.b = undefined
y.c = undefined
})

@@ -1,3 +0,11 @@

export type PartialPick<T, U extends keyof T> = Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>>
import { Pick } from './pick';
import { UnionKeys } from './UnionKeys';
export type PartialExcept<T, U extends keyof T> = Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>>
export type PartialPick<T, U extends UnionKeys<T>> = T extends T ? Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>> : never
/**
* @deprecated replaced by `PartialOmit`
*/
export type PartialExcept<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never
export type PartialOmit<T, U extends UnionKeys<T>> = T extends T ? Pick<T, U> & Partial<Pick<T, Exclude<keyof T, U>>> : never
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