@param {Record } options
(options)
| 118 | |
| 119 | /** @param {Record<string, unknown>} options */ |
| 120 | function getCircularValueOption (options) { |
| 121 | if (hasOwnProperty.call(options, 'circularValue')) { |
| 122 | const circularValue = options.circularValue |
| 123 | if (typeof circularValue === 'string') { |
| 124 | return `"${circularValue}"` |
| 125 | } |
| 126 | if (circularValue == null) { |
| 127 | return circularValue |
| 128 | } |
| 129 | if (circularValue === Error || circularValue === TypeError) { |
| 130 | return { |
| 131 | toString () { |
| 132 | throw new TypeError('Converting circular structure to JSON') |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined') |
| 137 | } |
| 138 | return stringifyCircularDepth |
| 139 | } |
| 140 | |
| 141 | function getDeterministicOption (options) { |
| 142 | let value |