* Checks if {@param buffer} starts with {@param start} * @param {Buffer} buffer * @param {Buffer} start * @param {{ position: number }} position
(buffer, start, position)
| 511 | * @param {{ position: number }} position |
| 512 | */ |
| 513 | function bufferStartsWith (buffer, start, position) { |
| 514 | if (buffer.length < start.length) { |
| 515 | return false |
| 516 | } |
| 517 | |
| 518 | for (let i = 0; i < start.length; i++) { |
| 519 | if (start[i] !== buffer[position.position + i]) { |
| 520 | return false |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | return true |
| 525 | } |
| 526 | |
| 527 | function parsingError (cause) { |
| 528 | return new TypeError('Failed to parse body as FormData.', { cause: new TypeError(cause) }) |
no outgoing calls
no test coverage detected