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

@simplysm/sd-core-common

Package Overview
Dependencies
Maintainers
0
Versions
641
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simplysm/sd-core-common - npm Package Compare versions

Comparing version 12.5.19 to 12.5.20

1

dist/extensions/ArrayExtension.d.ts

@@ -70,2 +70,3 @@ import { Type } from "../types/Type";

remove(selector: (item: T, index: number) => boolean): this;
toggle(item: T): this;
clear(): this;

@@ -72,0 +73,0 @@ }

@@ -430,2 +430,11 @@ import { NeverEntryError } from "../errors/NeverEntryError";

};
prototype.toggle = function (item) {
if (this.includes(item)) {
this.remove(item);
}
else {
this.push(item);
}
return this;
};
prototype.clear = function () {

@@ -432,0 +441,0 @@ return this.remove(() => true);

declare interface Map<K, V> {
getOrCreate(key: K, newValue: V): V;
getOrCreate(key: K, newValueFn: () => V): V;
update(key: K, updateFn: (v: V | undefined) => V): void;
}

27

dist/extensions/MapExtension.js
"use strict";
((prototype) => {
prototype.getOrCreate = function (key, newValue) {
if (!this.has(key)) {
if (newValue instanceof Function) {
this.set(key, newValue());
}
else {
this.set(key, newValue);
}
Map.prototype.getOrCreate = function (key, newValue) {
if (!this.has(key)) {
if (newValue instanceof Function) {
this.set(key, newValue());
}
return this.get(key);
};
})(Map.prototype);
else {
this.set(key, newValue);
}
}
return this.get(key);
};
Map.prototype.update = function (key, updateFn) {
const val = this.get(key);
const res = updateFn(val);
this.set(key, res);
};
//# sourceMappingURL=MapExtension.js.map
{
"name": "@simplysm/sd-core-common",
"version": "12.5.19",
"version": "12.5.20",
"description": "심플리즘 패키지 - 코어 모듈 (common)",

@@ -5,0 +5,0 @@ "author": "김석래",

@@ -125,2 +125,4 @@ import { Type } from "../types/Type";

toggle(item: T): this;
clear(): this;

@@ -812,2 +814,11 @@ }

prototype.toggle = function <T>(this: T[], item: T): T[] {
if (this.includes(item)) {
this.remove(item);
} else {
this.push(item);
}
return this;
};
prototype.clear = function <T>(this: T[]): T[] {

@@ -814,0 +825,0 @@ return this.remove(() => true);

@@ -5,17 +5,22 @@ declare interface Map<K, V> {

getOrCreate(key: K, newValueFn: () => V): V;
update(key: K, updateFn: (v: V | undefined) => V): void;
}
((prototype) => {
prototype.getOrCreate = function <K, V>(this: Map<K, V>, key: K, newValue: V | (() => V)): V {
if (!this.has(key)) {
if (newValue instanceof Function) {
this.set(key, newValue());
}
else {
this.set(key, newValue);
}
Map.prototype.getOrCreate = function <K, V>(this: Map<K, V>, key: K, newValue: V | (() => V)): V {
if (!this.has(key)) {
if (newValue instanceof Function) {
this.set(key, newValue());
} else {
this.set(key, newValue);
}
}
return this.get(key)!;
};
})(Map.prototype);
return this.get(key)!;
};
Map.prototype.update = function <K, V>(this: Map<K, V>, key: K, updateFn: (v: V | undefined) => V): void {
const val = this.get(key);
const res = updateFn(val);
this.set(key, res);
};
{
"extends": "../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {

@@ -4,0 +4,0 @@ "lib": [

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