1.1.2 • Published 5 years ago

array-object-flattener v1.1.2

Weekly downloads
11
License
ISC
Repository
-
Last release
5 years ago

Object Flattener

With this package you can flatten nested arrays and objects super simple.

Usage 🤱

  • flatten(object, null); default value, returns both keys and values
  • flatten(object, false); returns only values
  • flatten(object, true); returns only keys
const flatten = require('array-object-flattener');
const obj = {
  key1: 'stringValue',
  key2: ['arrayValue', 'arrayValue2'],
  key3: {
    obj1: [
      'objArrayValue',
      {
        obj2: 'Obj3Value1',
        obj3: 'obj4Value2'
      }
    ]
  }
};

flatten(obj);        // This will produce an array with all keys and values
flatten(obj, true);  // This will produce an array with all keys
flatten(obj, false); // This will produce an array with all values
1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago