* limit the toString() result according to option
(_obj: object)
| 185 | * limit the toString() result according to option |
| 186 | */ |
| 187 | function toString(_obj: object): string { |
| 188 | let str = _obj.toString(); |
| 189 | if (options.stringLengthLimit && str.length > options.stringLengthLimit) { |
| 190 | str = `${str.slice(0, options.stringLengthLimit)}...`; |
| 191 | } |
| 192 | return str; |
| 193 | } |
| 194 | } |