site.fabricate.prototype.schema
Namespace

Utility namespace for working with malli schemas, including a default registry and predicates used across Fabricate's implementation.

Functions

ns?
Description
Returns true if the given value is a Namespace or is a symbol that names a namespace.
Arguments
  • [v]
unify
Description
A lighter-weight version of malli's own unify/merge that's more compatible with number-based indexing/item access.
Arguments
  • [schemas]
ns-form?
Description
Returns true if the given form is a valid Clojure (ns ...) special form.
Arguments
  • [form]
malli?
Description
Returns true if the given form is a valid malli schema.
Arguments
  • [form]
has-reqd?
Description
Checks to see if at least one entry in the given map schema has required keys
Arguments
  • [schema]
throwable-map?
Description
Returns true if the given map matches the type returned by Throwable->map.
Arguments
    file?
    Description
    Returns true if the given value is a type that represents a file.
    Arguments
    • [v]
    subschema
    Description
    Uses the registry of the provided schema to create a schema for one of the reference schemas in that registry.
    Arguments
    • [schema new-ref]
    register!
    Description
    Add the `schema` specified by the `type` keyword to the global registry. Similar to `clojure.spec.alpha/def`.
    Arguments
    • [type schema]

    Constants

    registry
    Description
    Global registry for Fabricate's Malli schemas.
    Type
    clojure.lang.Atom
    throwable-map-schema
    Description
    Malli schema for the results of Throwable->map
    Type
    :malli.core/schema
    regex
    Description
    Malli schema for regular expressions.
    Type
    :malli.core/schema