Skip to content

Commit

Permalink
#168 use json-spread to flatten nested objects in json data arrays
Browse files Browse the repository at this point in the history
+ updated eslint dev dependency to latest
  • Loading branch information
RandomFractals committed Sep 28, 2020
1 parent 2857f79 commit 5649a64
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 44 deletions.
124 changes: 81 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.2",
"@types/vscode": "^1.49.0",
"eslint": "^7.9.0",
"eslint": "^7.10.0",
"@typescript-eslint/parser": "^4.2.0",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"typescript": "^4.0.3",
Expand All @@ -415,6 +415,7 @@
"js-yaml": "^3.14.0",
"json5": "^2.1.3",
"jsonc-parser": "2.3.1",
"json-spread": "0.3.2",
"properties": "^1.2.1",
"snappy": "^6.3.4",
"superagent": "^6.1.0",
Expand Down
5 changes: 5 additions & 0 deletions src/utils/json.utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as jsonSpread from 'json-spread';
import * as config from '../config';
import {Logger} from '../logger';

Expand All @@ -13,6 +14,10 @@ export function convertJsonData(data: any): any {
data = this.objectToPropertyArray(
this.flattenObject(data, true)); // preserve parent path
}
else {
// flatten json data array
data = jsonSpread(data);
}
return data;
}

Expand Down

0 comments on commit 5649a64

Please sign in to comment.