@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
1 lines • 716 B
Source Map (JSON)
{"version":3,"file":"findRefByID.cjs","sources":["../../../src/lib/findRefByID.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 ID.\n *\n * @param refs - A list of refs to search.\n * @param id - The ID of the ref to find.\n *\n * @returns The ref with a matching ID from the list.\n *\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByID = (refs: Ref[], id: string): Ref => {\n\treturn findRef(refs, (ref) => ref.id === id)\n}\n"],"names":["findRef"],"mappings":";;;AAca,MAAA,cAAc,CAAC,MAAa,OAAmB;AAC3D,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,OAAO,EAAE;AAC5C;;"}