File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export class Packr extends Unpackr {
2828 let structures
2929 let referenceMap
3030 let encodeUtf8 = ByteArray . prototype . utf8Write ? function ( string , position ) {
31- return target . utf8Write ( string , position , 0xffffffff )
31+ return target . utf8Write ( string , position , target . byteLength - position )
3232 } : ( textEncoder && textEncoder . encodeInto ) ?
3333 function ( string , position ) {
3434 return textEncoder . encodeInto ( string , target . subarray ( position ) ) . written
Original file line number Diff line number Diff line change 6060 textEncoder = new TextEncoder ( )
6161} catch ( error ) { }
6262const encodeUtf8 = hasNodeBuffer ? function ( target , string , position ) {
63- return target . utf8Write ( string , position , 0xffffffff )
63+ return target . utf8Write ( string , position , target . byteLength - position )
6464} : ( textEncoder && textEncoder . encodeInto ) ?
6565 function ( target , string , position ) {
6666 return textEncoder . encodeInto ( string , target . subarray ( position ) ) . written
You can’t perform that action at this time.
0 commit comments