@oliasoft-open-source/node-json-migrator 2.3.5-beta-1 → 2.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plan/plan.js +8 -1
- package/package.json +1 -1
package/dist/plan/plan.js
CHANGED
|
@@ -19,7 +19,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
* @param {String} json
|
|
20
20
|
* @returns {String} formatted json
|
|
21
21
|
*/
|
|
22
|
-
const formatJSON = json =>
|
|
22
|
+
const formatJSON = json => {
|
|
23
|
+
try {
|
|
24
|
+
return JSON.stringify(JSON.parse(json), null, 2);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.warn('Unable to parse JSON');
|
|
27
|
+
throw new Error(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
23
30
|
|
|
24
31
|
//https://stackoverflow.com/a/31102605/942635
|
|
25
32
|
exports.formatJSON = formatJSON;
|
package/package.json
CHANGED