( src: Buffer, prefix: Buffer, at: number, end: number, )
| 535 | } |
| 536 | |
| 537 | function hasPrefix( |
| 538 | src: Buffer, |
| 539 | prefix: Buffer, |
| 540 | at: number, |
| 541 | end: number, |
| 542 | ): boolean { |
| 543 | return ( |
| 544 | end - at >= prefix.length && |
| 545 | src.compare(prefix, 0, prefix.length, at, at + prefix.length) === 0 |
| 546 | ) |
| 547 | } |
| 548 | |
| 549 | const ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"') |
| 550 | const SYSTEM_PREFIX = Buffer.from('{"type":"system"') |
no outgoing calls
no test coverage detected