From 6027f0c388efc53229279cbb3125ddf2e0f06793 Mon Sep 17 00:00:00 2001 From: Clunt Date: Mon, 28 May 2018 15:40:32 +0800 Subject: [PATCH] feat(cli): add cli util parseJSON --- cli/util/index.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cli/util/index.js diff --git a/cli/util/index.js b/cli/util/index.js new file mode 100644 index 0000000..365cb7f --- /dev/null +++ b/cli/util/index.js @@ -0,0 +1,5 @@ +exports.parseJSON = str => { + try { + return JSON.parse(str); + } catch (e) {} +};