Socket
Socket
Sign inDemoInstall

@wixc3/common

Package Overview
Dependencies
Maintainers
65
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wixc3/common - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

10

dist/cjs/chain.d.ts

@@ -62,11 +62,11 @@ import { Flat, Mapping, Predicate } from './iterables';

export declare function chain<T, V extends NotIterable<T>>(value: V): ValueChain<V>;
export type IterableChain<T> = Chain<T> & {
export declare type IterableChain<T> = Chain<T> & {
value: Iterable<T>;
};
export type ValueChain<T> = Chain<T> & {
export declare type ValueChain<T> = Chain<T> & {
value: T;
};
export type NotIterable<T> = T extends Iterable<unknown> ? never : T;
export type Iter<T> = T extends Iterable<infer E> ? Iterable<E> : Iterable<T>;
export type Chain<T> = {
export declare type NotIterable<T> = T extends Iterable<unknown> ? never : T;
export declare type Iter<T> = T extends Iterable<infer E> ? Iterable<E> : Iterable<T>;
export declare type Chain<T> = {
last: () => ValueChain<T>;

@@ -73,0 +73,0 @@ first: () => ValueChain<T>;

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

export type PromiseResolveCb<T> = (value: T | PromiseLike<T>) => void;
export type PromiseRejectCb = (reason?: any) => void;
export declare type PromiseResolveCb<T> = (value: T | PromiseLike<T>) => void;
export declare type PromiseRejectCb = (reason?: any) => void;
export interface IDeferredPromise<T> {

@@ -4,0 +4,0 @@ promise: Promise<T>;

import { Nullable } from './types';
export type Mapping<S, T> = (src: S) => T;
export type Predicate<S, V = boolean> = (src: S) => V;
export type Flat<T> = T extends Iterable<infer A> ? A : T;
export declare type Mapping<S, T> = (src: S) => T;
export declare type Predicate<S, V = boolean> = (src: S) => V;
export declare type Flat<T> = T extends Iterable<infer A> ? A : T;
/**

@@ -6,0 +6,0 @@ * Picks the last element of an iterable

@@ -15,4 +15,4 @@ import { Nullable } from './types';

export declare function has(obj: null | undefined, key: unknown | never): false;
export type MapValue<T> = T extends Map<infer _, infer V> ? V : never;
export type ObjValue<O extends object, K extends keyof O = keyof O> = O[K];
export declare type MapValue<T> = T extends Map<infer _, infer V> ? V : never;
export declare type ObjValue<O extends object, K extends keyof O = keyof O> = O[K];
/**

@@ -19,0 +19,0 @@ * Similar to Map.get, but works for plain objects, and returns undefined

@@ -92,4 +92,4 @@ import type { UnionToIntersection } from './types';

declare const DELETE: unique symbol;
export type Remap<T> = Partial<Record<keyof T, string | typeof DELETE>>;
export type Remapped<T extends object, R> = UnionToIntersection<R extends Partial<Record<keyof T, string | typeof DELETE>> ? {
export declare type Remap<T> = Partial<Record<keyof T, string | typeof DELETE>>;
export declare type Remapped<T extends object, R> = UnionToIntersection<R extends Partial<Record<keyof T, string | typeof DELETE>> ? {
[K in keyof T]: K extends keyof R ? R[K] extends string ? {

@@ -101,3 +101,3 @@ [L in R[K]]: T[K];

}[keyof T] : never>;
export type RemapFunc = {
export declare type RemapFunc = {
<T extends object, R extends Remap<T>>(obj: T, rename: R): Remapped<T, R>;

@@ -104,0 +104,0 @@ readonly DELETE: typeof DELETE;

/**
* The resolved value of T (if a promise, otherwise simply T)
*/
export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
export declare type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
/**
* T or null/undefined
*/
export type Nullable<T> = T | null | undefined;
export declare type Nullable<T> = T | null | undefined;
/**

@@ -37,3 +37,3 @@ * Validates s is an instance of Map

*/
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
//# sourceMappingURL=types.d.ts.map

@@ -62,11 +62,11 @@ import { Flat, Mapping, Predicate } from './iterables';

export declare function chain<T, V extends NotIterable<T>>(value: V): ValueChain<V>;
export type IterableChain<T> = Chain<T> & {
export declare type IterableChain<T> = Chain<T> & {
value: Iterable<T>;
};
export type ValueChain<T> = Chain<T> & {
export declare type ValueChain<T> = Chain<T> & {
value: T;
};
export type NotIterable<T> = T extends Iterable<unknown> ? never : T;
export type Iter<T> = T extends Iterable<infer E> ? Iterable<E> : Iterable<T>;
export type Chain<T> = {
export declare type NotIterable<T> = T extends Iterable<unknown> ? never : T;
export declare type Iter<T> = T extends Iterable<infer E> ? Iterable<E> : Iterable<T>;
export declare type Chain<T> = {
last: () => ValueChain<T>;

@@ -73,0 +73,0 @@ first: () => ValueChain<T>;

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

export type PromiseResolveCb<T> = (value: T | PromiseLike<T>) => void;
export type PromiseRejectCb = (reason?: any) => void;
export declare type PromiseResolveCb<T> = (value: T | PromiseLike<T>) => void;
export declare type PromiseRejectCb = (reason?: any) => void;
export interface IDeferredPromise<T> {

@@ -4,0 +4,0 @@ promise: Promise<T>;

import { Nullable } from './types';
export type Mapping<S, T> = (src: S) => T;
export type Predicate<S, V = boolean> = (src: S) => V;
export type Flat<T> = T extends Iterable<infer A> ? A : T;
export declare type Mapping<S, T> = (src: S) => T;
export declare type Predicate<S, V = boolean> = (src: S) => V;
export declare type Flat<T> = T extends Iterable<infer A> ? A : T;
/**

@@ -6,0 +6,0 @@ * Picks the last element of an iterable

@@ -15,4 +15,4 @@ import { Nullable } from './types';

export declare function has(obj: null | undefined, key: unknown | never): false;
export type MapValue<T> = T extends Map<infer _, infer V> ? V : never;
export type ObjValue<O extends object, K extends keyof O = keyof O> = O[K];
export declare type MapValue<T> = T extends Map<infer _, infer V> ? V : never;
export declare type ObjValue<O extends object, K extends keyof O = keyof O> = O[K];
/**

@@ -19,0 +19,0 @@ * Similar to Map.get, but works for plain objects, and returns undefined

@@ -92,4 +92,4 @@ import type { UnionToIntersection } from './types';

declare const DELETE: unique symbol;
export type Remap<T> = Partial<Record<keyof T, string | typeof DELETE>>;
export type Remapped<T extends object, R> = UnionToIntersection<R extends Partial<Record<keyof T, string | typeof DELETE>> ? {
export declare type Remap<T> = Partial<Record<keyof T, string | typeof DELETE>>;
export declare type Remapped<T extends object, R> = UnionToIntersection<R extends Partial<Record<keyof T, string | typeof DELETE>> ? {
[K in keyof T]: K extends keyof R ? R[K] extends string ? {

@@ -101,3 +101,3 @@ [L in R[K]]: T[K];

}[keyof T] : never>;
export type RemapFunc = {
export declare type RemapFunc = {
<T extends object, R extends Remap<T>>(obj: T, rename: R): Remapped<T, R>;

@@ -104,0 +104,0 @@ readonly DELETE: typeof DELETE;

/**
* The resolved value of T (if a promise, otherwise simply T)
*/
export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
export declare type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
/**
* T or null/undefined
*/
export type Nullable<T> = T | null | undefined;
export declare type Nullable<T> = T | null | undefined;
/**

@@ -37,3 +37,3 @@ * Validates s is an instance of Map

*/
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
//# sourceMappingURL=types.d.ts.map
{
"name": "@wixc3/common",
"version": "6.0.0",
"version": "7.0.0",
"description": "Common utils, usable in all environments",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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