timepiece/node_modules/lit-html/directives/map.js.map

1 line
875 B
Plaintext
Raw Normal View History

2024-05-14 14:54:12 +00:00
{"version":3,"file":"map.js","sources":["../src/directives/map.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the result of calling `f(value)` on each\n * value in `items`.\n *\n * @example\n *\n * ```ts\n * render() {\n * return html`\n * <ul>\n * ${map(items, (i) => html`<li>${i}</li>`)}\n * </ul>\n * `;\n * }\n * ```\n */\nexport function* map<T>(\n items: Iterable<T> | undefined,\n f: (value: T, index: number) => unknown\n) {\n if (items !== undefined) {\n let i = 0;\n for (const value of items) {\n yield f(value, i++);\n }\n }\n}\n"],"names":["map","items","f","undefined","i","value"],"mappings":";;;;;SAsBiBA,EACfC,EACAC,GAEA,QAAcC,IAAVF,EAAqB,CACvB,IAAIG,EAAI,EACR,IAAK,MAAMC,KAASJ,QACZC,EAAEG,EAAOD,IAElB,CACH"}