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

tslang

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslang - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

42

library/mutation.d.ts

@@ -5,30 +5,40 @@ import {Primitive} from './types';

export type KeyOfValueWithType<T extends object, TValue> = {
[K in keyof T]: T[K] extends TValue ? K : never
}[keyof T];
export type KeyOfValueWithType<TObject extends object, TValue> = {
[K in keyof TObject]: TObject[K] extends TValue ? K : never
}[keyof TObject];
export type KeyOfValueNotWithType<T extends object, TValue> = {
[K in keyof T]: T[K] extends TValue ? never : K
}[keyof T];
export type KeyOfValueNotWithType<TObject extends object, TValue> = {
[K in keyof TObject]: TObject[K] extends TValue ? never : K
}[keyof TObject];
// Extract values
export type ValueWithType<TObject extends object, TValue> = {
[K in keyof TObject]: TObject[K] extends TValue ? TObject[K] : never
}[keyof TObject];
// Keep or omit values by keys
export type KeepValueOfKey<
T extends object,
TKey extends keyof T
> = T extends object ? Pick<T, Extract<keyof T, TKey>> : never;
TObject extends object,
TKey extends keyof TObject
> = TObject extends object
? Pick<TObject, Extract<keyof TObject, TKey>>
: never;
export type OmitValueOfKey<
T extends object,
TKey extends keyof T
> = T extends object ? Pick<T, Exclude<keyof T, TKey>> : never;
TObject extends object,
TKey extends keyof TObject
> = TObject extends object
? Pick<TObject, Exclude<keyof TObject, TKey>>
: never;
// Keep or omit values with given type
export type KeepValueWithType<T extends object, TValue> = {
[K in KeyOfValueWithType<T, TValue>]: T[K]
export type KeepValueWithType<TObject extends object, TValue> = {
[K in KeyOfValueWithType<TObject, TValue>]: TObject[K]
};
export type OmitValueWithType<T extends object, TValue> = {
[K in KeyOfValueNotWithType<T, TValue>]: T[K]
export type OmitValueWithType<TObject extends object, TValue> = {
[K in KeyOfValueNotWithType<TObject, TValue>]: TObject[K]
};

@@ -35,0 +45,0 @@

{
"name": "tslang",
"version": "0.1.2",
"version": "0.1.3",
"description": "TypeScript Language Type Utilities.",

@@ -5,0 +5,0 @@ "license": "MIT",

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