@punks/backend-core 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -297,8 +297,13 @@ const mergeDeep = (a, b) => {
297
297
  return c;
298
298
  };
299
299
  const jsonSerialize = (obj, options) => {
300
- const { stripBinaryData = true, prettify = false } = options ?? {};
300
+ const { stripBinaryData = true, prettify = false, maxStringsLength, } = options ?? {};
301
301
  const replacer = (key, value) => {
302
+ if (typeof value === "string" && maxStringsLength) {
303
+ return value.length > maxStringsLength
304
+ ? `${value.substring(0, maxStringsLength)}...`
305
+ : value;
306
+ }
302
307
  if (stripBinaryData) {
303
308
  if (value instanceof Buffer) {
304
309
  return `<binary data (${value.length} bytes)>`;