Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Fix calcHex
Browse files Browse the repository at this point in the history
  • Loading branch information
lelinhtinh committed Nov 15, 2020
1 parent 02ac659 commit 7b46556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var utils = {
str = str.replace(/(?<!['"])(?<!\w)0x[a-f\d]+((?<!\w)0x[a-f\d]+|[+\-*/])*(?<!\w)0x[a-f\d]+(?!['"])/gi, (m) =>
math.format(eval(m), 14),
);
str = str.replace(/(?<=[\(=,!?:\|\&+\-*/])\s*0x[a-f\d]+\s*(?=[\);,?:\|\&+\-*/])/gi, (m) => parseInt(m));
str = str.replace(/(?<=[[(=<>,!?:|&+\-*/])\s*0x[a-f\d]+\s*(?=([\])=<>,?:|&+\-*/]|$))/gi, (m) => parseInt(m));
return str;
},

Expand Down

0 comments on commit 7b46556

Please sign in to comment.