Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

map-object

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-object

A method for mapping dict objects as if it were an array

  • 1.1.1
  • PyPI
  • Socket score

Maintainers
1

Map Object

A python implementation of the map-obj function

Installation

pip install map_object

Usage

.. code:: python

from map_object import mapObject

def mapper (key, value, source):
  return [value, ley]

newObject = mapObject({'foo'='bar'}, mapper);
# => {bar: 'foo'}

API

mapObject(source, mapper)


source
^^^^^^

Type: ``Object``

Source object to copy properties from.

mapper
^^^^^^

Type: ``Function``

Mapping function.

-  It has signature ``mapper(sourceKey, sourceValue, source)``
-  It must return a two item array: ``[targetKey, targetValue]``.

License
=======

MIT


FAQs


Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc