Namespace: validate

Interfaces

Type Aliases

Path

Ƭ Path: (string | number)[]

Path comprised of string keys for objects and index numbers for arrays.


ValidationErrorMessage

Ƭ ValidationErrorMessage: "File not found" | "No initial state set" | "Initial state not found" | "Transition target state not found"

All possible validation error messages.

Functions

validateMachine

validateMachine(machine, fs): Promise<ValidationError[]>

Validate machine data. Uses a file system provider interface to allow running in different environments. The resulting array will have one error per property path, meaning a single node can have multiple error objects.

Note that since the individual validators run asynchronously the order of the validation errors is not guaranteed.

Parameters

Name Type Description
machine Machine Machine data to validate
fs FileSystemProvider File system interface

Returns

Promise<ValidationError[]>