davidmarkclements / fast-safe-stringify

Safely and quickly serialize JavaScript objects
MIT License
348 stars 27 forks source link

fix: add max depth limit and max edges limit #51

Closed matus-sabo closed 3 years ago

matus-sabo commented 3 years ago

fix for #https://github.com/pinojs/pino/issues/990

ahmedsuleman commented 3 years ago

Hi!

I ran into same problem as described in https://githubmemory.com/repo/pinojs/pino/issues/990?page=2. I am using winston-cloudwatch (2.3.2) that requires/uses fast-safe-stringify (2.0.7).

@lamanabie is the fix available in version 2.1.0! As I can see, the latest available version is 2.0.8. https://www.npmjs.com/package/fast-safe-stringify

Regards, Suleman

simoneb commented 3 years ago

@ahmedsuleman because this PR has not been merged, the fix is not available in any published version of the package.

ahmedsuleman commented 3 years ago

fix for #pinojs/pino#990

  • new feature to handle big deep objects - when limit reached object will be replaced with [...]
  • new optional parameter options
  • set default limits to

    • depthLimit 10 - how deep parse input object
    • edgesLimit 20 - how deep parse object keys or array items
  • test for optional parameter options
  • updated changelog & readme
  • bump minor version to 2.1.0

@ahmedsuleman because this PR has not been merged, the fix is not available in any published version of the package.

Ah ok! Looking forward to it :)