Update Tests & Make TypeScript happy

This commit is contained in:
SukkaW
2024-10-02 21:33:59 +08:00
parent 9735d05956
commit d1041f0e59
7 changed files with 31 additions and 12 deletions

View File

@@ -6,16 +6,16 @@ import { bench, group, run } from 'mitata';
(async () => {
const data = await processLineFromReadline(await fetchRemoteTextByLine('https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt'));
group('setAddFromArray', () => {
bench('run', () => {
group(() => {
bench('setAddFromArray', () => {
const set = new Set(['1', '2', '1', '3', 'skk.moe']);
for (let i = 0, len = data.length; i < len; i++) {
set.add(data[i]);
}
});
});
group('setAddFromArray', () => {
bench('run', () => {
group(() => {
bench('', () => {
const set = new Set(['1', '2', '1', '3', 'skk.moe']);
// eslint-disable-next-line @typescript-eslint/unbound-method -- thisArg is passed
data.forEach(set.add, set);