@gik/tools-mapper
v0.0.7
Published
Flattens an object to a key-val dictionary. Part of our [tools suite](http://github.com/gikmx/tools)
Downloads
8
Readme
@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.
- MapperResult
mapper
Generates a flattened object containing a map for all the properties
available on subject
.
Parameters
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 }
Types
Members
MapperResult
static typedef of
Types
A map to all the properties contained in an object.