@dhmk/utils
Advanced tools
Comparing version 4.2.1 to 4.2.2
@@ -12,3 +12,3 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types"; | ||
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>): any; | ||
export declare function objectTransform<T, K extends keyof any = keyof T, V = T[keyof T]>(src: T, mapEntry: (v: T[keyof T], k: keyof T, src: T) => readonly [K, V] | null): Record<K, V>; | ||
export declare function objectTransform<T extends object, K extends keyof any = keyof T, V = T[keyof T]>(src: T, mapEntry: (v: T[keyof T], k: keyof T, src: T) => readonly [K, V] | null): Record<K, V>; | ||
export declare function getter<T>(t: T, k: keyof T): Readonly<{ | ||
@@ -15,0 +15,0 @@ use<R>(value: R): R; |
@@ -93,6 +93,5 @@ var __assign = (this && this.__assign) || function () { | ||
return b; | ||
var res = __assign({}, a); | ||
var res = __assign(__assign({}, a), b); // copy symbols | ||
for (var k in b) { | ||
var v = b[k]; | ||
res[k] = mergeDeepRec(a[k], v); | ||
res[k] = mergeDeepRec(a[k], b[k]); | ||
} | ||
@@ -99,0 +98,0 @@ return res; |
@@ -14,3 +14,3 @@ export declare class Tag<T> { | ||
export declare type Primitive = undefined | boolean | string | number | symbol | bigint; | ||
export declare type NotPlainObject = Primitive | null | Function | Date | RegExp | ReadonlyArray<any> | ReadonlySet<any> | ReadonlyMap<any, any>; | ||
export declare type NotPlainObject = Primitive | null | Function | Date | RegExp | Error | ReadonlyArray<any> | ReadonlySet<any> | ReadonlyMap<any, any>; | ||
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer T> ? ReadonlySet<DeepReadonly<T>> : { | ||
@@ -17,0 +17,0 @@ readonly [P in keyof T]: DeepReadonly<T[P]>; |
@@ -12,3 +12,3 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types"; | ||
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>): any; | ||
export declare function objectTransform<T, K extends keyof any = keyof T, V = T[keyof T]>(src: T, mapEntry: (v: T[keyof T], k: keyof T, src: T) => readonly [K, V] | null): Record<K, V>; | ||
export declare function objectTransform<T extends object, K extends keyof any = keyof T, V = T[keyof T]>(src: T, mapEntry: (v: T[keyof T], k: keyof T, src: T) => readonly [K, V] | null): Record<K, V>; | ||
export declare function getter<T>(t: T, k: keyof T): Readonly<{ | ||
@@ -15,0 +15,0 @@ use<R>(value: R): R; |
@@ -110,6 +110,5 @@ "use strict"; | ||
return b; | ||
var res = __assign({}, a); | ||
var res = __assign(__assign({}, a), b); // copy symbols | ||
for (var k in b) { | ||
var v = b[k]; | ||
res[k] = mergeDeepRec(a[k], v); | ||
res[k] = mergeDeepRec(a[k], b[k]); | ||
} | ||
@@ -116,0 +115,0 @@ return res; |
@@ -14,3 +14,3 @@ export declare class Tag<T> { | ||
export declare type Primitive = undefined | boolean | string | number | symbol | bigint; | ||
export declare type NotPlainObject = Primitive | null | Function | Date | RegExp | ReadonlyArray<any> | ReadonlySet<any> | ReadonlyMap<any, any>; | ||
export declare type NotPlainObject = Primitive | null | Function | Date | RegExp | Error | ReadonlyArray<any> | ReadonlySet<any> | ReadonlyMap<any, any>; | ||
export declare type DeepReadonly<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer T> ? ReadonlySet<DeepReadonly<T>> : { | ||
@@ -17,0 +17,0 @@ readonly [P in keyof T]: DeepReadonly<T[P]>; |
{ | ||
"name": "@dhmk/utils", | ||
"version": "4.2.1", | ||
"version": "4.2.2", | ||
"description": "A collection of frequently used functions and primitives", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
122208
2821