{"version":3,"file":"getOptionalLinkProperties.cjs","names":[],"sources":["../../src/lib/getOptionalLinkProperties.ts"],"sourcesContent":["import type { OptionalLinkProperties } from \"../types/value/link\"\n\n/**\n * Returns optional properties only available to link fields. Link fields can have the same shape as\n * content relationship and link to media fields, requiring special treatment to extract\n * link-specific properties.\n *\n * @param input - The content relationship or link to media field from which the link properties\n *   will be extracted.\n * @returns Optional link properties that `input` might have.\n */\nexport const getOptionalLinkProperties = (\n\tinput: OptionalLinkProperties,\n): OptionalLinkProperties => {\n\tconst res: OptionalLinkProperties = {}\n\n\tif (\"text\" in input) {\n\t\tres.text = input.text\n\t}\n\n\tif (\"variant\" in input) {\n\t\tres.variant = input.variant\n\t}\n\n\treturn res\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,6BACZ,UAC4B;CAC5B,MAAM,MAA8B,EAAE;AAEtC,KAAI,UAAU,MACb,KAAI,OAAO,MAAM;AAGlB,KAAI,aAAa,MAChB,KAAI,UAAU,MAAM;AAGrB,QAAO"}