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

@dhmk/utils

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhmk/utils - npm Package Compare versions

Comparing version 4.3.2 to 4.3.3

2

esm/std.d.ts

@@ -11,3 +11,3 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types";

export declare function objectMap<T extends object, V extends ValueMapper<T>>(src: T, mapValue: V): Record<StrKeyOf<T>, ReturnType<V>>;
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>): any;
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>, mapSymbol?: (v: T[keyof T & symbol], k: keyof T & symbol, src: T) => unknown): any;
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>;

@@ -14,0 +14,0 @@ export declare function getter<T>(t: T, k: keyof T): Readonly<{

@@ -42,11 +42,15 @@ var __assign = (this && this.__assign) || function () {

}
export function objectMap(src, mapValue, mapKey) {
export function objectMap(src, mapValue, mapKey, mapSymbol) {
if (mapKey === void 0) { mapKey = id; }
return objectFrom(Object.keys(src).map(function (k) { return [
mapKey(k, src[k], src),
mapValue(src[k], k, src),
]; }));
if (mapSymbol === void 0) { mapSymbol = id; }
return objectFrom(Object.keys(src)
.map(function (k) { return [mapKey(k, src[k], src), mapValue(src[k], k, src)]; })
.concat(Object.getOwnPropertySymbols(src).map(function (k) { return [
k,
mapSymbol(src[k], k, src),
]; })));
}
export function objectTransform(src, mapEntry) {
return objectFrom(Object.keys(src)
.concat(Object.getOwnPropertySymbols(src))
.map(function (k) { return mapEntry(src[k], k, src); })

@@ -53,0 +57,0 @@ .filter(Boolean));

@@ -11,3 +11,3 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types";

export declare function objectMap<T extends object, V extends ValueMapper<T>>(src: T, mapValue: V): Record<StrKeyOf<T>, ReturnType<V>>;
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>): any;
export declare function objectMap<T extends object>(src: T, mapValue: ValueMapper<T>, mapKey?: KeyMapper<T>, mapSymbol?: (v: T[keyof T & symbol], k: keyof T & symbol, src: T) => unknown): any;
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>;

@@ -14,0 +14,0 @@ export declare function getter<T>(t: T, k: keyof T): Readonly<{

@@ -51,8 +51,11 @@ "use strict";

exports.objectFrom = objectFrom;
function objectMap(src, mapValue, mapKey) {
function objectMap(src, mapValue, mapKey, mapSymbol) {
if (mapKey === void 0) { mapKey = exports.id; }
return objectFrom(Object.keys(src).map(function (k) { return [
mapKey(k, src[k], src),
mapValue(src[k], k, src),
]; }));
if (mapSymbol === void 0) { mapSymbol = exports.id; }
return objectFrom(Object.keys(src)
.map(function (k) { return [mapKey(k, src[k], src), mapValue(src[k], k, src)]; })
.concat(Object.getOwnPropertySymbols(src).map(function (k) { return [
k,
mapSymbol(src[k], k, src),
]; })));
}

@@ -62,2 +65,3 @@ exports.objectMap = objectMap;

return objectFrom(Object.keys(src)
.concat(Object.getOwnPropertySymbols(src))
.map(function (k) { return mapEntry(src[k], k, src); })

@@ -64,0 +68,0 @@ .filter(Boolean));

{
"name": "@dhmk/utils",
"version": "4.3.2",
"version": "4.3.3",
"description": "A collection of frequently used functions and primitives",

@@ -5,0 +5,0 @@ "keywords": [

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