Boolean shape model and factories.
Defines shapes and factories for validating boolean values, mapping the JSON boolean type to the XSD 1.1 boolean datatype.
¹ XSD 1.1 datatypes are referenced by RDF 1.1 and JSON-LD 1.1 as normative * Compatibility
true
false
¹ Canonical form: true, false
Defining Boolean Shapes
import { boolean } from '@metreeca/blue';const flag = boolean(); // default model: falseconst enabled = boolean({ model: true }); // custom model value Copy
import { boolean } from '@metreeca/blue';const flag = boolean(); // default model: falseconst enabled = boolean({ model: true }); // custom model value
Using in Resource Shapes
import { resource, required, optional, boolean } from '@metreeca/blue';const Product = resource({ available: required(boolean()), featured: optional(boolean())}); Copy
import { resource, required, optional, boolean } from '@metreeca/blue';const Product = resource({ available: required(boolean()), featured: optional(boolean())});
Shape definition for boolean values.
Constraints for the boolean shape factory.
Checks whether a value is a BooleanShape.
Checks whether a value is a valid BooleanConstraints object.
Creates a boolean shape.
Boolean shape model and factories.
Defines shapes and factories for validating boolean values, mapping the JSON boolean type to the XSD 1.1 boolean datatype.
¹ XSD 1.1 datatypes are referenced by RDF 1.1 and JSON-LD 1.1 as normative * Compatibility
true,falsetrue,false¹ Canonical form:
true,falseDefining Boolean Shapes
Using in Resource Shapes
See