DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
raw
history blame
672 Bytes
var UniqueIDGeneretor = require('./UniqueIDGeneretor');
function HashMap() {
this.map = {};
this.keys = [];
}
HashMap.prototype.put = function (key, value) {
var theId = UniqueIDGeneretor.createID(key);
if (!this.contains(theId)) {
this.map[theId] = value;
this.keys.push(key);
}
};
HashMap.prototype.contains = function (key) {
var theId = UniqueIDGeneretor.createID(key);
return this.map[key] != null;
};
HashMap.prototype.get = function (key) {
var theId = UniqueIDGeneretor.createID(key);
return this.map[theId];
};
HashMap.prototype.keySet = function () {
return this.keys;
};
module.exports = HashMap;