invert-association

1.0.1 • Public • Published

invert-association

key -> array to each in array as key -> key as value

Installation

npm i invert-association -SE

Testing

npm test

Basic Example

invertAssoc({
  series: [ 'episode', 'season', 'creator' ]
}) 
// -> { episode: 'series', season: 'series', creator: 'series' }

Impetus

The purpose of this module is to tranform a set of one-to-many associations into a set of many-to-one relationships. Areas that this can be useful are:

  • DAOs
  • Validators
  • Serializers

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

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

Package Sidebar

Install

npm i invert-association

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • jameswomack