From c021f64ed0ca468087a3326ed6d9390abe79cdb0 Mon Sep 17 00:00:00 2001 From: alina sireneva Date: Sun, 5 May 2024 21:00:32 +0300 Subject: [PATCH] fix(core): inspect longs as strings --- packages/core/src/highlevel/utils/inspectable.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/highlevel/utils/inspectable.ts b/packages/core/src/highlevel/utils/inspectable.ts index fad49e67..787f2f6f 100644 --- a/packages/core/src/highlevel/utils/inspectable.ts +++ b/packages/core/src/highlevel/utils/inspectable.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument */ +import Long from 'long' + import { getPlatform } from '../../platform.js' const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom') @@ -57,6 +59,8 @@ export function makeInspectable( if (val && typeof val === 'object') { if (val instanceof Uint8Array) { val = getPlatform().base64Encode(val) + } else if (Long.isLong(val)) { + val = val.toString() } else if (typeof val.toJSON === 'function') { val = val.toJSON(true) }