Skip to content

Commit

Permalink
Update uint8array-extras methods to version 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Jun 29, 2024
1 parent fa45728 commit 4caaee2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Token from 'token-types';
import * as strtok3 from 'strtok3/core';
import {findSequence, readUIntBE} from 'uint8array-extras';
import {indexOf, getUintBE} from 'uint8array-extras';
import {
stringToBytes,
tarHeaderChecksumMatches,
Expand Down Expand Up @@ -474,7 +474,7 @@ export class FileTypeParser {
while (nextHeaderIndex < 0 && (tokenizer.position < tokenizer.fileInfo.size)) {
await tokenizer.peekBuffer(this.buffer, {mayBeLess: true});

nextHeaderIndex = findSequence(this.buffer, new Uint8Array([0x50, 0x4B, 0x03, 0x04]));
nextHeaderIndex = indexOf(this.buffer, new Uint8Array([0x50, 0x4B, 0x03, 0x04]));

// Move position to the next header if found, skip the whole buffer otherwise
await tokenizer.ignore(nextHeaderIndex >= 0 ? nextHeaderIndex : this.buffer.length);
Expand Down Expand Up @@ -713,7 +713,7 @@ export class FileTypeParser {
await tokenizer.readBuffer(buffer, {mayBeLess: true});

// Check if this is an Adobe Illustrator file
if (findSequence(buffer, new TextEncoder().encode('AIPrivateData')) >= 0) {
if (indexOf(buffer, new TextEncoder().encode('AIPrivateData')) >= 0) {
return {
ext: 'ai',
mime: 'application/postscript',
Expand Down Expand Up @@ -791,8 +791,8 @@ export class FileTypeParser {
const lengthView = new DataView(lengthField.buffer, lengthField.length - nrLength, nrLength);

return {
id: readUIntBE(idView),
len: readUIntBE(lengthView),
id: getUintBE(idView),
len: getUintBE(lengthView),
};
}

Expand Down

0 comments on commit 4caaee2

Please sign in to comment.