Fix missing uint8array-extras dependency
This commit is contained in:
@@ -158,20 +158,3 @@ export function toRatio(value: string): IRatio | undefined {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const byteToHexLookupTable = Array.from({length: 256}, (_, index) => index.toString(16).padStart(2, '0'));
|
||||
|
||||
export function uint8ArrayToHex(array: Uint8Array): string {
|
||||
|
||||
// Concatenating a string is faster than using an array.
|
||||
let hexString = '';
|
||||
|
||||
// eslint-disable-next-line unicorn/no-for-loop -- Max performance is critical.
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
hexString += byteToHexLookupTable[array[index]];
|
||||
}
|
||||
|
||||
return hexString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ChapterTrackReferenceBox, Mp4ContentError, } from './AtomToken.js';
|
||||
import { type AnyTagValue, type IChapter, type ITrackInfo, TrackType } from '../type.js';
|
||||
|
||||
import type { IGetToken } from '@tokenizer/token';
|
||||
import { uint8ArrayToHex } from '../common/Util.js';
|
||||
import { uint8ArrayToHex } from 'uint8array-extras';
|
||||
|
||||
import { textDecode } from '@borewit/text-codec';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { BasicParser } from '../common/BasicParser.js';
|
||||
import { BlockHeaderToken, type IBlockHeader, type IMetadataId, MetadataIdToken } from './WavPackToken.js';
|
||||
|
||||
import initDebug from 'debug';
|
||||
import { uint8ArrayToHex } from '../common/Util.js';
|
||||
import { uint8ArrayToHex } from 'uint8array-extras';
|
||||
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
||||
|
||||
const debug = initDebug('music-metadata:parser:WavPack');
|
||||
|
||||
Reference in New Issue
Block a user