@gik/tools-mapper

0.0.7 • Public • Published

@gik/tools-mapper 0.0.7

Flattens an object to a key-val dictionary. Part of our tools suite

Contributors
Supported platforms
  • darwin
  • linux

Table of contents

  • mapper Generates a flattened object containing a map for all the properties
  • Types ``
    • MapperResult typedef A map to all the properties contained in an object.

mapper

Generates a flattened object containing a map for all the properties available on subject.

Parameters
subject Object The object you want to map.
Returns

mapperResult - A flattened object.

Throws
  • mapperTypeError
Example
const subject = {
    a: {
        b: {
           d: true,
           e:  {
               g: 'foo'
           }
        },
        f: undefined,
    }
};
const result = Mapper(subject);
// result:
// { 'a.b.d': true, 'a.b.e.g': 'foo', 'a.f': undefined }

▲ Top


Types

Members

▲ Top


MapperResult

static typedef of Types

A map to all the properties contained in an object.

▲ Top


Readme

Keywords

Package Sidebar

Install

npm i @gik/tools-mapper

Homepage

gik.mx

Weekly Downloads

1

Version

0.0.7

License

MIT

Last publish

Collaborators

  • etor