map-invert
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

map-invert

Invert Maps. Keys become values and values become keys. Returns a new Map.

import mapInvert from "map-invert";

const myMap = new Map([
  [1, "foo"],
  [2, "bar"],
  [3, "baz"],
]);

const inverted = mapInvert(myMap);

inverted.get("baz");
// => 3

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i map-invert

Weekly Downloads

0

Version

1.0.0

License

Unlicense

Unpacked Size

3.71 kB

Total Files

6

Last publish

Collaborators

  • evanhahn