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

@bunt/util

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bunt/util - npm Package Compare versions

Comparing version 0.24.9 to 0.24.10

3

dist/Map/XMap.d.ts

@@ -0,5 +1,6 @@

export declare type XMapInitializer<K, V> = (key: K) => V;
export declare class XMap<K, V> extends Map<K, V> {
#private;
constructor(initializer?: (key: K) => V);
ensure(key: K, initializer?: (key: K) => V): V;
ensure(key: K, initializer?: XMapInitializer<K, V> | undefined): V;
}

@@ -17,2 +17,3 @@ "use strict";

const assert_1 = require("../assert");
const is_1 = require("../is");
class XMap extends Map {

@@ -24,7 +25,5 @@ constructor(initializer) {

}
ensure(key, initializer) {
initializer = initializer ?? __classPrivateFieldGet(this, _XMap_initializer, "f");
const value = this.get(key);
ensure(key, initializer = __classPrivateFieldGet(this, _XMap_initializer, "f")) {
const exists = this.has(key);
if (!exists && initializer) {
if (!exists && (0, is_1.isFunction)(initializer)) {
const value = initializer(key);

@@ -34,4 +33,4 @@ this.set(key, value);

}
(0, assert_1.assert)(!exists, `The key doesn't exists: ${key}`);
return value;
(0, assert_1.assert)(exists, `The key doesn't exists: ${key}`);
return this.get(key);
}

@@ -38,0 +37,0 @@ }

{
"name": "@bunt/util",
"version": "0.24.9",
"version": "0.24.10",
"keywords": [

@@ -29,3 +29,3 @@ "typescript"

"license": "MIT",
"gitHead": "5339d2fa4e496960063b7fa2f5d0e4ce43e421e3"
"gitHead": "c4806b42c01121da77d820a41dc1d4c33e0a3e53"
}

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