This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
// Если свойство — объект, рекурсивно строим пути через точку |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
// Если свойство — объект, рекурсивно строим пути через точку |