{ } qjs-modules

extendMap

Source: lib/extendMap.js (pure JS) — default export: extendMap

Installs extra (non-enumerable) methods onto Map.prototype.

Exports

ExportArgsKindDescription
extendMap(proto=Map.prototype)0–1functionInstalls the extensions. (default export)
MapExtensions—constThe bag of methods that get installed.
MapPrototype—constShortcut for Map.prototype.

Added Map.prototype methods

MethodDescription
getOrInsert(key, value)Returns the value for key, inserting value if absent.
getOrInsertComputed(key, fn)Like getOrInsert but computes the default via fn(key).

Export list

Generated by utilities/doc-api.js from the extendMap dump of utilities/api-surface.sh: 20 members. Edit the text above this block, not the block.

Functions: MapPrototype[Symbol.iterator](), MapPrototype[Symbol.toStringTag](), default(), extendMap()

MapExtensions

object

  • static methods: getOrInsert(), getOrInsertComputed()

MapPrototype

object

  • static methods: clear(), delete(), entries(), forEach(), get(), getOrInsert(), getOrInsertComputed(), has(), keys(), set(), size(), values()