Files
klz-cables.com/.pnpm-store/v10/files/87/4ef7bfed2b83992840778e963bbbca011c9ecad7ec0003b469e4477eb1da8fae5fa7e458774cd9a3be186e21f3b9710acb39de5e364a208a9b1da77e9ba1e4
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

8 lines
981 B
Plaintext

import { Prettify } from "../prettify";
type ExtractFromObject<Obj extends Record<PropertyKey, unknown>, Key> = Key extends keyof Obj ? Obj[Key] : Key extends keyof NonNullable<Obj> ? NonNullable<Obj>[Key] | undefined : undefined;
type ExtractFromArray<Arr extends readonly any[], Key> = any[] extends Arr ? Arr extends readonly (infer T)[] ? T | undefined : undefined : Key extends keyof Arr ? Arr[Key] : undefined;
type GetWithArray<Type, Path, PrettifiedType = Prettify<Type>> = Path extends [] ? Type : Path extends [infer Key, ...infer Rest] ? PrettifiedType extends Record<PropertyKey, unknown> ? GetWithArray<ExtractFromObject<PrettifiedType, Key>, Rest> : Type extends readonly any[] ? GetWithArray<ExtractFromArray<Type, Key>, Rest> : undefined : never;
type Path<Type> = Type extends `${infer Key}.${infer Rest}` ? [Key, ...Path<Rest>] : Type extends `${infer Key}` ? [Key] : [];
export type PathValue<Type, StringPath> = GetWithArray<Type, Path<StringPath>>;
export {};