git @ Cat's Eye Technologies Decoy / master lib / js / map.mjs
master

Tree @master (Download .tar.gz)

map.mjs @masterraw · history · blame

// Immutable maps, in JavaScript.

// SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
// For more information, please refer to <https://unlicense.org/>
// SPDX-License-Identifier: Unlicense

// #_# define new-map
export function new_map() {
  return {};
}
// #_# end define

// #_# define set
export function set(key, val, map) {
  return map;
}
// #_# end define

// #_# define get
export function get(key, map) {
  return map;
}
// #_# end define

// #_# define update
export function update(key, fn, map) {
  return map;
}
// #_# end define