This commit is contained in:
Akko
2025-01-21 19:11:39 +01:00
parent 37fdefdfa4
commit 71f708ff8c
1004 changed files with 100768 additions and 700 deletions

View File

@@ -0,0 +1,80 @@
goog.loadModule(function(exports) {
function setAll(map, entries) {
if (!entries) {
return;
}
for (const [k, v] of entries) {
map.set(k, v);
}
}
function hasValue(map, val, valueEqualityFn = defaultEqualityFn) {
for (const v of map.values()) {
if (valueEqualityFn(v, val)) {
return true;
}
}
return false;
}
function equals(map, otherMap, valueEqualityFn = defaultEqualityFn) {
if (map === otherMap) {
return true;
}
if (map.size !== otherMap.size) {
return false;
}
for (const key of map.keys()) {
if (!otherMap.has(key)) {
return false;
}
if (!valueEqualityFn(map.get(key), otherMap.get(key))) {
return false;
}
}
return true;
}
function transpose(map) {
const transposed = new Map();
for (const key of map.keys()) {
const val = map.get(key);
transposed.set(val, key);
}
return transposed;
}
function toObject(map) {
const obj = {};
for (const key of map.keys()) {
obj[key] = map.get(key);
}
return obj;
}
"use strict";
goog.module("goog.collections.maps");
goog.module.declareLegacyNamespace();
class MapLike {
constructor() {
this.size;
}
set(key, val) {
}
get(key) {
}
keys() {
}
values() {
}
has(key) {
}
}
exports.MapLike = MapLike;
exports.setAll = setAll;
exports.hasValue = hasValue;
const defaultEqualityFn = (a, b) => {
return a === b;
};
exports.equals = equals;
exports.transpose = transpose;
exports.toObject = toObject;
return exports;
});
//# sourceMappingURL=goog.collections.maps.js.map