UNPKG

encompass-gc-optimized-collections

Version:

Provides GC optimized collections in TypeScript and Lua for use with Encompass-TS

35 lines 790 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class GCOptimizedMap { constructor(...entries) { this.items = new Map(entries); } get size() { return this.items.size; } entries() { return this.items; } clear() { for (const [k, v] of this.items) { this.delete(k); } return; } delete(key) { return this.items.delete(key); } get(key) { return this.items.get(key); } has(key) { return this.items.has(key); } set(key, value) { this.items.set(key, value); return this; } } GCOptimizedMap.Empty = new GCOptimizedMap(); exports.GCOptimizedMap = GCOptimizedMap; //# sourceMappingURL=gc_optimized_map.js.map