Skip to content

Commit c5bbc44

Browse files
committed
chore: added more benchmarks
1 parent 55c2da7 commit c5bbc44

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

bench/convert.bench.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { bench } from 'vitest';
2+
3+
import { convert, type ConvertRecord } from '../src/convert.js';
4+
5+
const input = {
6+
firstName: 'Test',
7+
lastName: 'Testerson',
8+
age: 42,
9+
};
10+
11+
const converter: ConvertRecord<typeof input, { fullName: string; age: number }> = {
12+
fullName: (data) => data.firstName + ' ' + data.lastName,
13+
age: (data) => data.age,
14+
};
15+
16+
bench('convert()', () => {
17+
convert(input, converter);
18+
});

bench/getOwnProperties.bench.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { bench } from 'vitest';
2+
3+
import { getOwnProperties } from '../src/getOwnProperties.js';
4+
5+
bench('getOwnProperties()', () => {
6+
getOwnProperties(globalThis);
7+
});

0 commit comments

Comments
 (0)