Skip to content

Instantly share code, notes, and snippets.

View Isqanderm's full-sized avatar

Aleksandr Melnik Isqanderm

View GitHub Profile
@Isqanderm
Isqanderm / Mapper.performance-benchmark.lazy.ts
Created May 10, 2025 10:43
performance comparison of mappers
import { Suite } from 'benchmark';
type Transformer<T, Result> = (source: T) => Result;
type IsObjectWithProperties<T> =
T extends Record<string, any> ? true : false;
type DeepPath<Source, K extends keyof Source> =
K extends string
? IsObjectWithProperties<Source[K]> extends true
// Если свойство — объект, рекурсивно строим пути через точку
@Isqanderm
Isqanderm / Mapper.performance-benchmark.lazy.ts
Created May 10, 2025 09:36
comparison of mapper performance
import { Suite } from 'benchmark';
type Transformer<T, Result> = (source: T) => Result;
type IsObjectWithProperties<T> =
T extends Record<string, any> ? true : false;
type DeepPath<Source, K extends keyof Source> =
K extends string
? IsObjectWithProperties<Source[K]> extends true
// Если свойство — объект, рекурсивно строим пути через точку