UNPKG

molstar

Version:

A comprehensive macromolecular library.

47 lines 1.3 kB
/** * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ import { iterableToArray } from '../util'; var IntMap; (function (IntMap) { IntMap.Empty = new Map(); function keyArray(map) { return iterableToArray(map.keys()); } IntMap.keyArray = keyArray; function Mutable() { return new Map(); } IntMap.Mutable = Mutable; function asImmutable(map) { return map; } IntMap.asImmutable = asImmutable; function copy(map) { var ret = Mutable(); var it = map.keys(); while (true) { var _a = it.next(), done = _a.done, value = _a.value; if (done) break; ret.set(value, map.get(value)); } return ret; } IntMap.copy = copy; function addFrom(map, src) { var it = src.keys(); while (true) { var _a = it.next(), done = _a.done, value = _a.value; if (done) break; map.set(value, src.get(value)); } return map; } IntMap.addFrom = addFrom; })(IntMap || (IntMap = {})); export { IntMap }; //# sourceMappingURL=map.js.map