@byloth/core 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +18 -18
- package/dist/core.esm.js.map +1 -1
- package/dist/core.global.js +1 -1
- package/dist/core.global.js.map +1 -1
- package/dist/core.umd.cjs +1 -1
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1 -1
- package/src/models/collections/map-view.ts +7 -3
- package/src/models/collections/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byloth/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "An unopinionated collection of useful functions and classes that I use widely in all my projects. 🔧",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Core",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@byloth/eslint-config-typescript": "^3.1.0",
|
|
53
53
|
"@eslint/compat": "^1.2.9",
|
|
54
|
-
"@types/node": "^22.15.
|
|
55
|
-
"@vitest/coverage-v8": "^3.1.
|
|
56
|
-
"eslint": "^9.
|
|
54
|
+
"@types/node": "^22.15.21",
|
|
55
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
56
|
+
"eslint": "^9.27.0",
|
|
57
57
|
"husky": "^9.1.7",
|
|
58
58
|
"jsdom": "^26.1.0",
|
|
59
59
|
"typescript": "^5.8.3",
|
|
60
60
|
"vite": "^6.3.5",
|
|
61
|
-
"vitest": "^3.1.
|
|
61
|
+
"vitest": "^3.1.4"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"dev": "vite",
|
package/src/index.ts
CHANGED
|
@@ -112,10 +112,14 @@ export default class MapView<K, V> extends Map<K, V>
|
|
|
112
112
|
*/
|
|
113
113
|
public override delete(key: K): boolean
|
|
114
114
|
{
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
115
|
+
const value = this.get(key);
|
|
116
|
+
if (value === undefined) { return false; }
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
super.delete(key);
|
|
119
|
+
|
|
120
|
+
this._publisher.publish("entry:remove", key, value);
|
|
121
|
+
|
|
122
|
+
return true;
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
/**
|
|
@@ -17,7 +17,7 @@ import type SetView from "./set-view.js";
|
|
|
17
17
|
export interface MapViewEventsMap<K, V>
|
|
18
18
|
{
|
|
19
19
|
"entry:add": (key: K, value: V) => void;
|
|
20
|
-
"entry:remove": (key: K) => void;
|
|
20
|
+
"entry:remove": (key: K, value: V) => void;
|
|
21
21
|
|
|
22
22
|
"collection:clear": () => void;
|
|
23
23
|
}
|