MCPcopy Create free account
hub / github.com/melonjs/melonJS / put

Method put

packages/melonjs/src/utils/array-multimap.js:9–16  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

7 this._map = new Map();
8 }
9 put(key, value) {
10 const arr = this._map.get(key);
11 if (arr) {
12 arr.push(value);
13 } else {
14 this._map.set(key, [value]);
15 }
16 }
17 get(key) {
18 return this._map.get(key) || [];
19 }

Callers 2

setMethod · 0.80

Calls 3

getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected