Skip to content

Commit fdc614d

Browse files
committed
chore: rename stringify function
1 parent 47019c8 commit fdc614d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/curve-ui-kit/src/lib/logging.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ const getStatusStyle = (status: LogStatus) => {
4545
}
4646
}
4747

48-
// Wagmi uses bigints in query keys and args, so need to add support for serialization of bigints
49-
const bigIntStringify = (obj: unknown) =>
48+
// Wagmi uses bigints in query keys and args, so need to add in serialization support
49+
const stringify = (obj: unknown) =>
5050
JSON.stringify(obj, (_, value) => (typeof value === 'bigint' ? value.toString() : value))
5151

5252
function argToString(i: unknown, max = 200, trailing = 3) {
5353
let str
5454
try {
55-
str = bigIntStringify(i)
55+
str = stringify(i)
5656
} catch {
5757
return String(i)
5858
}
@@ -82,7 +82,7 @@ export function log(key: LogKey, status?: LogStatus | unknown, ...args: unknown[
8282
formattedString += '%c → '
8383
styles.push('color: #666; font-size: 0.75em;')
8484
}
85-
formattedString += `%c${typeof part === 'string' ? part : bigIntStringify(part)}`
85+
formattedString += `%c${typeof part === 'string' ? part : stringify(part)}`
8686
styles.push('color: #4CAF50; font-weight: bold;')
8787
})
8888

@@ -102,7 +102,7 @@ export function log(key: LogKey, status?: LogStatus | unknown, ...args: unknown[
102102
}
103103
if (isCypress || typeof window === 'undefined') {
104104
// disable formatting when on cypress or server side. Electron prints logs to the output, but formatting breaks.
105-
return logMethod(status)(bigIntStringify({ status, keyArray, args }).slice(0, 300))
105+
return logMethod(status)(stringify({ status, keyArray, args }).slice(0, 300))
106106
}
107107

108108
const hasDefinedStatus = status && Object.values(LogStatus).includes(status as LogStatus)

0 commit comments

Comments
 (0)