@opencreek/ext
Advanced tools
Comparing version 2.0.0--canary.22.3712435423.0 to 2.0.0--canary.22.3712483523.0
@@ -5,3 +5,7 @@ declare type PairSplit<T> = T extends [infer F, infer L] ? [Chain<F>, Chain<L>] : never; | ||
export declare function objChain<K extends string | number | symbol, T>(value: Record<K, T> | ObjectChain<K, T> | Chain<readonly [K, T]>): ObjectChain<K, T>; | ||
export declare function objChain<_K extends string | number | symbol, _T>(value: undefined | null): undefined; | ||
export declare function objChain<K extends string | number | symbol, T>(value: Record<K, T> | ObjectChain<K, T> | Chain<readonly [K, T]> | undefined | null): ObjectChain<K, T> | undefined; | ||
export declare function chain<T>(value: ReadonlyArray<T> | Chain<T> | Iterable<T>): Chain<T>; | ||
export declare function chain<_T>(value: undefined | null): undefined; | ||
export declare function chain<T>(value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null): Chain<T> | undefined; | ||
export declare class ObjectChain<K extends string | number | symbol, T> { | ||
@@ -8,0 +12,0 @@ private val; |
@@ -16,2 +16,4 @@ "use strict"; | ||
function objChain(value) { | ||
if (value == null) | ||
return undefined; | ||
if (value instanceof ObjectChain) { | ||
@@ -27,2 +29,4 @@ return value; | ||
function chain(value) { | ||
if (value == null) | ||
return undefined; | ||
if (value instanceof Chain) | ||
@@ -29,0 +33,0 @@ return value; |
{ | ||
"name": "@opencreek/ext", | ||
"version": "2.0.0--canary.22.3712435423.0", | ||
"version": "2.0.0--canary.22.3712483523.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -40,3 +40,23 @@ import { | ||
value: Record<K, T> | ObjectChain<K, T> | Chain<readonly [K, T]> | ||
): ObjectChain<K, T> { | ||
): ObjectChain<K, T> | ||
export function objChain<_K extends string | number | symbol, _T>( | ||
value: undefined | null | ||
): undefined | ||
export function objChain<K extends string | number | symbol, T>( | ||
value: | ||
| Record<K, T> | ||
| ObjectChain<K, T> | ||
| Chain<readonly [K, T]> | ||
| undefined | ||
| null | ||
): ObjectChain<K, T> | undefined | ||
export function objChain<K extends string | number | symbol, T>( | ||
value: | ||
| Record<K, T> | ||
| ObjectChain<K, T> | ||
| Chain<readonly [K, T]> | ||
| undefined | ||
| null | ||
): ObjectChain<K, T> | undefined { | ||
if (value == null) return undefined | ||
if (value instanceof ObjectChain) { | ||
@@ -58,3 +78,11 @@ return value | ||
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | ||
): Chain<T> { | ||
): Chain<T> | ||
export function chain<_T>(value: undefined | null): undefined | ||
export function chain<T>( | ||
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null | ||
): Chain<T> | undefined | ||
export function chain<T>( | ||
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null | ||
): Chain<T> | undefined { | ||
if (value == null) return undefined | ||
if (value instanceof Chain) return value | ||
@@ -61,0 +89,0 @@ if (Array.isArray(value)) return new Chain(value) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108455
1961