(value)
| 128 | } |
| 129 | |
| 130 | function convertValue(value) { |
| 131 | if (value === null) return ''; |
| 132 | |
| 133 | if (utils.isDate(value)) { |
| 134 | return value.toISOString(); |
| 135 | } |
| 136 | |
| 137 | if (utils.isBoolean(value)) { |
| 138 | return value.toString(); |
| 139 | } |
| 140 | |
| 141 | if (!useBlob && utils.isBlob(value)) { |
| 142 | throw new AxiosError('Blob is not supported. Use a Buffer instead.'); |
| 143 | } |
| 144 | |
| 145 | if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { |
| 146 | if (useBlob && typeof _Blob === 'function') { |
| 147 | return new _Blob([value]); |
| 148 | } |
| 149 | if (typeof Buffer !== 'undefined') { |
| 150 | return Buffer.from(value); |
| 151 | } |
| 152 | throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); |
| 153 | } |
| 154 | |
| 155 | return value; |
| 156 | } |
| 157 | |
| 158 | function throwIfMaxDepthExceeded(depth) { |
| 159 | if (depth > maxDepth) { |
no test coverage detected