Skip to content

Commit

Permalink
Merge pull request #89 from AElfProject/fix/parseJSON
Browse files Browse the repository at this point in the history
feat: fix parse JSON
  • Loading branch information
hzz780 authored Aug 13, 2024
2 parents 46a3f30 + 12eb30f commit 1d91276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aelf-command",
"version": "0.1.47-beta.11",
"version": "0.1.48",
"description": "A CLI tools for AElf",
"main": "src/index.js",
"type": "module",
Expand Down
3 changes: 3 additions & 0 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ function parseJSON(str = '') {
let result = null;
try {
result = JSON.parse(str);
if (typeof result === 'number' && /^-?\d+(\.\d+)?[eE][+-]?\d+$/.test(String(result))) {
result = str;
}
} catch (e) {
result = str;
}
Expand Down

0 comments on commit 1d91276

Please sign in to comment.