How to use the @sanity/validation.inferFromSchema function in @sanity/validation

To help you get started, we’ve selected a few @sanity/validation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / base / src / schema / createSchema.js View on Github external
imageMetadata,
      imageDimensions,
      imagePalette,
      imagePaletteSwatch
    ].filter(Boolean)
  }

  const compiled = Schema.compile({
    name: schemaDef.name,
    types
  })

  compiled._source = schemaDef
  compiled._validation = validation

  return inferValidation(compiled)
}

@sanity/validation

Validation and warning infrastructure for Sanity projects

MIT
Latest version published 1 year ago

Package Health Score

81 / 100
Full package analysis