Skip to content

Commit 22317a1

Browse files
authored
Merge pull request #64 from sharefe-demo/master
refactor: better to check the constructor
2 parents 0123086 + 401b898 commit 22317a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/js/helpers/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function toType (obj, bigNumber) {
44
/* Check if the object is an instance of the custom BigNumber class passed in as a prop
55
* If it matches, return 'bigNumber' type so it can be displayed appropriately
66
*/
7-
if (bigNumber && obj?.constructor?.name === bigNumber?.name) {
7+
if (bigNumber && obj?.constructor === bigNumber) {
88
return 'bigNumber'
99
}
1010
let type = getType(obj)

0 commit comments

Comments
 (0)