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"
All possible validation error messages.
Functions
validateLayout
▸ validateLayout(layout
, fs
): Promise
<ValidationError
[]>
Validate layout 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 |
---|---|---|
layout |
Layout |
Layout data to validate |
fs |
FileSystemProvider |
File system interface |
Returns
Promise
<ValidationError
[]>