-
Notifications
You must be signed in to change notification settings - Fork 0
Utils.Function.is_identifier
DecentM edited this page Aug 27, 2024
·
57 revisions
@decentm/concourse-ts / Utils / is_identifier
is_identifier<
IdentifierType
>(input
):input is IdentifierType
Returns if the input is a valid Identifier, using the compiler's validator.
https://concourse-ci.org/config-basics.html#schema.identifier
Example:
const name = 'my-name'
// ^? string
new Job(name) // Compilation error
if (!is_identifier(name)) {
return
}
new Job(name) // No error
// ^? Identifier
• IdentifierType extends Identifier
= Identifier
• input: unknown
The potential Identifier to check
input is IdentifierType
Type guard for valid identifiers, using branded types.