JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25662
  • Score
    100M100P100Q136543F
  • License KINDLY

Array-map like function for objects.

Package Exports

  • map-o

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (map-o) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

map-o Donate now

Array-map like function for objects.

Installation

$ npm i map-o

Example

// Dependencies
var Mapo = require("map-o");

// Modify this object
console.log(Mapo({
    location: "Earth"
  , age: 10
}, function (name, value) {
    if (name === "location") {
        return "Location: " + value;
    }

    if (value === 10) {
        return 42;
    }
}));
// => { location: 'Location: Earth', age: 42 }

Documentation

Mapo(obj, fn, clone)

Array-map like for objects.

Params

  • Object obj: The input object.
  • Function fn: A function returning the field values.
  • Boolean clone: If true, the input object will be cloned, so the original object will not be changed.

Return

  • Object The modified object.

proto()

Appends the map method to the Object prototype.

How to contribute

Have an idea? Found a bug? See how to contribute.

License

KINDLY © Ionică Bizău–The LICENSE file contains a copy of the license.