Files
klz-cables.com/.pnpm-store/v10/files/7c/35d0ea4185a161373b71a0a6ae685217153d5383d145b95041421b7f54728737c3f419e5be119b3980668d5841312b9b54e88a61e60a0381cbc89de86d76f0
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

24 lines
611 B
Plaintext

import type { ObjMap } from './ObjMap';
/**
* Creates a keyed JS object from an array, given a function to produce the keys
* and a function to produce the values from each item in the array.
* ```ts
* const phoneBook = [
* { name: 'Jon', num: '555-1234' },
* { name: 'Jenny', num: '867-5309' }
* ]
*
* // { Jon: '555-1234', Jenny: '867-5309' }
* const phonesByName = keyValMap(
* phoneBook,
* entry => entry.name,
* entry => entry.num
* )
* ```
*/
export declare function keyValMap<T, V>(
list: ReadonlyArray<T>,
keyFn: (item: T) => string,
valFn: (item: T) => V,
): ObjMap<V>;