import { arrayToSentence, truncate, } from '../../../../../helpers/arrayToSentence'; export const missingLinkKeyErrorMessage = ( missingKeys: Array, ): string => `${arrayToSentence(missingKeys)} must be included in the additional link`; export function invalidLinkKeyErrorMessage( propertyName: string, validProperties: string[], ): string { const truncatedPropertyName = truncate(propertyName); return `"${truncatedPropertyName}" of additional link must be one of the following keys: ${validProperties.join( ', ', )}`; } export const invalidLinkTypeErrorMessage = ( type: string, validTypes: string[], ): string => `"${truncate( type, )}" is not a valid additional link type. The accepted values are: ${validTypes.join( ', ', )}`; export const linksCountOfTypeExceededErrorMessage = ( type: string, maxLinksOfType: number, ): string => `Exceeded allowed total links count of ${maxLinksOfType} for the type ${type}`; export const invalidUrlSchemeErrorMessage = (scheme: string): string => `URL scheme "${scheme}" is not allowed in additional link`; export const invalidUrlErrorMessage = (): string => `URL of additional link is not valid`; export const maxLinkNameLengthErrorMessage = (length: number): string => `"name" field of additional link is too long. Try again with a value no longer than ${length} characters.`; export const invalidLinkNameErrorMessage = (): string => `Invalid additional link "name" field value`;