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.4.0 to 4.4.1

1

esm/std.d.ts

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

export declare function overwrite<T extends object>(x: T, fn: (x: T) => Partial<T>): T;
export declare function memoize<A extends any[], R>(fn: (...args: A) => R): (...args: A) => R;
export {};

@@ -156,1 +156,18 @@ var __assign = (this && this.__assign) || function () {

}
export function memoize(fn) {
var prevArgs;
var prevResult;
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (prevArgs && arraysEqual(prevArgs, args)) {
return prevResult;
}
prevArgs = undefined; // in case of exception
prevResult = fn.apply(void 0, args);
prevArgs = args;
return prevResult;
};
}

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

export declare function overwrite<T extends object>(x: T, fn: (x: T) => Partial<T>): T;
export declare function memoize<A extends any[], R>(fn: (...args: A) => R): (...args: A) => R;
export {};

@@ -23,3 +23,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.overwrite = exports.diff = exports.flatMap = exports.isPlainObject = exports.assert = exports.namespace = exports.join = exports.mergeDeep = exports.merge = exports.deepReadonly = exports.call = exports.createFactoryAs = exports.createFactory = exports.getter = exports.objectTransform = exports.objectMap = exports.objectFrom = exports.shallowEqual = exports.arraysEqual = exports.range = exports.id = exports.noop = void 0;
exports.memoize = exports.overwrite = exports.diff = exports.flatMap = exports.isPlainObject = exports.assert = exports.namespace = exports.join = exports.mergeDeep = exports.merge = exports.deepReadonly = exports.call = exports.createFactoryAs = exports.createFactory = exports.getter = exports.objectTransform = exports.objectMap = exports.objectFrom = exports.shallowEqual = exports.arraysEqual = exports.range = exports.id = exports.noop = void 0;
var noop = function () { };

@@ -182,1 +182,19 @@ exports.noop = noop;

exports.overwrite = overwrite;
function memoize(fn) {
var prevArgs;
var prevResult;
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (prevArgs && (0, exports.arraysEqual)(prevArgs, args)) {
return prevResult;
}
prevArgs = undefined; // in case of exception
prevResult = fn.apply(void 0, args);
prevArgs = args;
return prevResult;
};
}
exports.memoize = memoize;

2

package.json
{
"name": "@dhmk/utils",
"version": "4.4.0",
"version": "4.4.1",
"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