multikey-map
Advanced tools
Comparing version 0.1.2 to 0.2.0
export declare class MultikeyMap<K extends any[], V> { | ||
private weak; | ||
private map; | ||
constructor(weak?: boolean); | ||
constructor(); | ||
get(keys: K): V | undefined; | ||
@@ -6,0 +5,0 @@ has(keys: K): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var mixed_map_1 = require("mixed-map"); | ||
var MultikeyMap = (function () { | ||
function MultikeyMap(weak) { | ||
if (weak === void 0) { weak = false; } | ||
this.weak = weak; | ||
this.map = createMap(weak); | ||
function MultikeyMap() { | ||
this.map = new mixed_map_1.default(); | ||
} | ||
@@ -25,3 +24,2 @@ MultikeyMap.prototype.get = function (keys) { | ||
var map = this.map; | ||
var weak = this.weak; | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -43,3 +41,3 @@ var key = keys[i]; | ||
else { | ||
map = mapValue.map = createMap(weak); | ||
map = mapValue.map = new mixed_map_1.default(); | ||
} | ||
@@ -105,5 +103,2 @@ continue; | ||
exports.default = MultikeyMap; | ||
function createMap(weak) { | ||
return weak ? new WeakMap() : new Map(); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "multikey-map", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Multikey Map", | ||
@@ -20,3 +20,6 @@ "scripts": { | ||
"vts": "^5.6.1" | ||
}, | ||
"dependencies": { | ||
"mixed-map": "^0.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8155
1
111
+ Addedmixed-map@^0.1.0
+ Addedmixed-map@0.1.2(transitive)