(reader, signature, startOffset, minimumBytes, maximumLength)
| 4269 | } |
| 4270 | |
| 4271 | async function seekSignature(reader, signature, startOffset, minimumBytes, maximumLength) { |
| 4272 | const signatureArray = new Uint8Array(4); |
| 4273 | const signatureView = getDataView$1(signatureArray); |
| 4274 | setUint32$1(signatureView, 0, signature); |
| 4275 | const maximumBytes = minimumBytes + maximumLength; |
| 4276 | return (await seek(minimumBytes)) || await seek(Math.min(maximumBytes, startOffset)); |
| 4277 | |
| 4278 | async function seek(length) { |
| 4279 | const offset = startOffset - length; |
| 4280 | const bytes = await readUint8Array(reader, offset, length); |
| 4281 | for (let indexByte = bytes.length - minimumBytes; indexByte >= 0; indexByte--) { |
| 4282 | if (bytes[indexByte] == signatureArray[0] && bytes[indexByte + 1] == signatureArray[1] && |
| 4283 | bytes[indexByte + 2] == signatureArray[2] && bytes[indexByte + 3] == signatureArray[3]) { |
| 4284 | return { |
| 4285 | offset: offset + indexByte, |
| 4286 | buffer: bytes.slice(indexByte, indexByte + minimumBytes).buffer |
| 4287 | }; |
| 4288 | } |
| 4289 | } |
| 4290 | } |
| 4291 | } |
| 4292 | |
| 4293 | function getOptionValue$1(zipReader, options, name) { |
| 4294 | return options[name] === UNDEFINED_VALUE ? zipReader.options[name] : options[name]; |
no test coverage detected
searching dependent graphs…