acceptsLink
Does `url` satisfy an `accepts` token — a `LinkKind` or a single `LinkProviderId`?
Does url satisfy an accepts token — a LinkKind or a single LinkProviderId?
Import from @homepages/template-kit.
Signature
Section titled “Signature”function acceptsLink(accepts: string, url: string): booleanParameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
accepts |
string |
required | A url slot’s accepts value. An unrecognized token |
always yields false: a typo must fail closed, never accept everything. |
|||
url |
string |
required |
Returns
Section titled “Returns”boolean
Constraints
Section titled “Constraints”- Callers handle the empty-value case themselves — an empty
urlslot is legal regardless ofaccepts(clearing a slot is not a validity question).
See also
Section titled “See also”collectionForSlotisLinkAcceptsmatchLinkProvidertourEmbedUrlvideoEmbedUrlCOLLECTIONSCONTENT_SLOT_TYPESDECISION_TYPESLINK_KINDSLINK_PROVIDERSLINK_STRATEGIESREF_SLOT_TYPESREFERRAL_FIELDSREFERRAL_IMAGE_FIELDSSLOT_TYPESSOURCE_FIELDSVIDEO_SOURCESLinkProviderCollectionFieldCollectionIdKeyCollectionOwnershipContentSlotTypeDecisionTypeLinkKindLinkProviderIdLinkStrategyReferralFieldReferralImageFieldRefSlotTypeSlotTypeSourceFieldContainerSourceFieldDescriptorSourceFieldNameSourceFieldValueTypeVideoSourceWritebackTarget