Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 1x 1x 1x 1x 1x 1x 5x 1x | import v10 from './v10'; let decode = v10; const hasBuffer = typeof Buffer !== 'undefined'; const utf8Slice = hasBuffer ? Buffer.prototype.utf8Slice : null; if (utf8Slice) { decode = (buf: Uint8Array, start: number, length: number): string => length <= 10 ? v10(buf, start, length) : utf8Slice.call(buf, start, start + length); } else E{ const from = hasBuffer ? Buffer.from : null; if (from) { decode = (buf: Uint8Array, start: number, length: number): string => length < 30 ? v10(buf, start, length) : from(buf) .subarray(start, start + length) .toString(); } else Iif (typeof TextDecoder !== 'undefined') { const decoder = new TextDecoder(); decode = (buf: Uint8Array, start: number, length: number): string => length < 150 ? v10(buf, start, length) : decoder.decode(buf.subarray(start, start + length)); } } export default decode; |