Skip to content

validate ​

Interfaces ​

InterfaceDescription
OperationDependencyOne edge of the dependency graph: a related operation and where it sits.
OperationNodeOne node of operationGraph: an operation with both of its edge lists already resolved.

Type Aliases ​

Type AliasDescription
DependencyKindHow one operation relates to another.
DiagnosticA single finding produced by validateOperations.
DiagnosticSeverityHow serious a Diagnostic is.
ValidationContextOptions for validateOperations.

Variables ​

VariableDescription
CORE_OPERATIONSOperations that make the CDN actually process an image. A chain without one of these delivers the original file untouched — and they are exactly the operations the format/jpeg dimension ceiling applies to, which is why the set lives here and validateOperations re-exports it.
INFO_OPERATIONSInfo-returning operations: a chain built only from these needs no core operation, because it returns metadata rather than an image.
MUST_BE_LAST_OPERATIONSOperations that must be the last directive in the chain. Video thumbs~N is subject to the same rule — use mustBeLast, which handles the counted suffix.
OPERATION_MODIFIERSTarget operation → the operations that configure it. The table this model is built on; exported so callers can enumerate rather than probe.
STACKABLE_OPERATIONSStackable operations — those that may legitimately appear more than once in a chain. Repeating anything else is a duplicate-operation warning, since the CDN applies only the last occurrence.

Functions ​

FunctionDescription
isCoreOperationWhether an operation is a core (image-processing) one.
isOperationModifierWhether an operation is state for a later one, rather than an effect in its own right — the operations for which operationDependents can be non-empty.
isStackableWhether repeating this operation in a chain is meaningful. false means the CDN keeps only the last occurrence.
mustBeLastWhether the operation has to be the final directive in its chain. Handles counted video operations, so thumbs~5 reports true.
operationDependentsThe inverse of operationInputs: the operations that the one identified by ref affects. For a modifier that is every following target it still reaches; for format/jpeg it is every core operation in the chain.
operationGraphThe whole chain as a dependency graph, one node per operation in order. Use this instead of querying node by node: it needs no ref lookup, addresses repeated operations unambiguously by position, and is what the validator itself runs on.
operationInputsThe operations feeding the one identified by ref — the state that configures it, plus any chain-wide limit that applies to it. Empty when the operation has no modelled dependencies or is absent from the chain.
validateOperationsValidates an operation chain against the documented CDN rules. Pass { conversion: 'video' } etc. to apply conversion-path rules instead of image rules.