Socket
Socket
Sign inDemoInstall

object-keys-map

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    object-keys-map

`Array.prototype.map` for object keys


Version published
Maintainers
1
Created

Readme

Source

object-keys-map

Build Status

Array.prototype.map for object keys.

Usage

var assert = require('assert');
var objmap = require('object-keys-map');

var o1 = {
  foo: 'bar',
  bar: 'foo'
};

objmap(o1, function (key) {
  return 'foo/' + key;
}); // => `{ 'foo/foo': 'bar', 'foo/bar': 'foo' }`

API

objectKeysMap(obj, iterator, this)

  • obj (object) - object to map on
  • iterator (function, required) - iterator function
  • this (optional) - this for iterator

Iterates over keys of obj and creates a new object with keys based on return value of iterator and values from obj.

Keywords

FAQs

Last updated on 29 Nov 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc