3.0.0 • Published 6 months ago
@codaco/protocol-validation v3.0.0
@codaco/protocol-validation
This npm package implements methods for validating Network Canvas protocol files against an appropriate JSON schema.
It exports three methods:
- validateSchema - validates a schema against the JSON schema
const { hasErrors, errors } = validateSchema(schemaJson);- validateLogic - validates the logic of the protocol to ensure there are no inconsistencies. This includes validations that cannot be implemented within the JSON schema.
const { hasErrors, errors } = validateLogic(protocolJson);- validateProtocol - validates the protocol against the schema and logic.
try {
validateProtocol(protocolJson, schemaJson);
// schema is valid
} catch (e) {
if (e instanceof ValidationError) {
// schema is invalid. e.schemaErrors and e.dataErrors contain the errors
} else {
// some other error happened during the process
}
}It also exports migration functionality for migrating protocols from one version to another.
const migratedProtocol = migrateProtocol(8, protocolJson);4.0.0-alpha.9
7 months ago
4.0.0-alpha.7
7 months ago
4.0.0-alpha.8
7 months ago
4.0.0-alpha.5
8 months ago
4.0.0-alpha.6
7 months ago
4.0.0-alpha.3
8 months ago
4.0.0-alpha.4
8 months ago
4.0.0-alpha.1
9 months ago
4.0.0-alpha.2
8 months ago
4.0.0-alpha.11
6 months ago
4.0.0-alpha.10
6 months ago
3.0.0
1 year ago
3.0.0-alpha.4
2 years ago
3.0.0-alpha.3
2 years ago
3.0.0-alpha.2
2 years ago
3.0.0-alpha.1
2 years ago