Skip to content

Schema - ReferenceError: Schema is not defined #20

@bigoper

Description

@bigoper

Thank you for writing this, I find your library to be super helpful!

ISSUE
Upon execution of your example, I get the following error:

ReferenceError: Schema is not defined

I was not able to locate your definition/import of Schema in your code.

CODE

// custom validation function checking value for a regex
const checkHexColor = val => {
  return /^#[0-9a-fA-F]$/.test(val)
}

const car = new Schema({
  color: {
    type: String,
    use: { checkHexColor }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions