1
0
mirror of synced 2026-05-22 14:43:19 +00:00

Fix missing uint8array-extras dependency

This commit is contained in:
Borewit
2025-08-19 11:43:42 +02:00
committed by Borewit
parent 1f6444c00b
commit 06d83b2e7a
6 changed files with 243 additions and 222 deletions
-17
View File
@@ -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;
}
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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');