@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
1 lines • 745 B
Source Map (JSON)
{"version":3,"file":"findRefByLabel.cjs","sources":["../../../src/lib/findRefByLabel.ts"],"sourcesContent":["import type { Ref } from \"../types/api/ref\"\n\nimport { findRef } from \"./findRef\"\n\n/**\n * Returns the ref from a list of given refs with a matching label.\n *\n * @param refs - A list of refs to search.\n * @param id - The label of the ref to find.\n *\n * @returns The ref with a matching label from the list.\n *\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByLabel = (refs: Ref[], label: string): Ref => {\n\treturn findRef(refs, (ref) => ref.label === label)\n}\n"],"names":["findRef"],"mappings":";;;AAca,MAAA,iBAAiB,CAAC,MAAa,UAAsB;AACjE,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,UAAU,KAAK;AAClD;;"}