Skip to main content

CommonValidatorFunctions

Home > @backstage/catalog-model > CommonValidatorFunctions

Contains various helper validation and normalization functions that can be composed to form a Validator.

Signature:

class CommonValidatorFunctions 

Methods

MethodModifiersDescription
isJsonSafe(value)staticChecks that the value can be safely transferred as JSON.
isNonEmptyString(value)staticChecks that the value is a string value that's not empty.
isValidDnsLabel(value)staticChecks that the value is a valid DNS label.
isValidDnsSubdomain(value)staticChecks that the value is a valid DNS subdomain name.
isValidPrefixAndOrSuffix(value, separator, isValidPrefix, isValidSuffix)staticChecks that the value is on the form <suffix> or <prefix><separator><suffix>, and validates those parts separately.
isValidString(value)staticChecks that the value is a non empty string value.
isValidTag(value)staticChecks that the value is a valid tag.
isValidUrl(value)staticChecks that the value is a valid string URL.