This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Flattens a json object into a single-dimensional representation | |
| * @param: stripPrefix: boolean | |
| * by default, subobjects will have their property name prefixed to the flattened property name. | |
| * This is done to prevent overwriting of properties with the same name. If this is a non-issue | |
| * for your data type, then feel free to set this to true | |
| * @return: a single dimensional copy of the original object | |
| */ | |
| Object.defineProperty(Object.prototype, 'flatten', { | |
| value: function(stripPrefix) { |