@expo/schemer

  • Version 1.3.31
  • Published
  • 39 kB
  • 5 dependencies
  • MIT license

Install

npm i @expo/schemer
yarn add @expo/schemer
pnpm add @expo/schemer

Overview

Centralized scheme validation library for Expo

Index

Variables

variable ErrorCodes

const ErrorCodes: {
SCHEMA_VALIDATION_ERROR: string;
SCHEMA_ADDITIONAL_PROPERTY: string;
SCHEMA_MISSING_REQUIRED_PROPERTY: string;
SCHEMA_INVALID_PATTERN: string;
INVALID_ASSET_URI: string;
INVALID_DIMENSIONS: string;
INVALID_CONTENT_TYPE: string;
NOT_SQUARE: string;
};

    Classes

    class Schemer

    class Schemer {}

      constructor

      constructor(schema: {}, options?: Options);

        property ajv

        ajv: any;

          property manualValidationErrors

          manualValidationErrors: ValidationError[];

            property options

            options: Options;

              property rootDir

              rootDir: string;

                property schema

                schema: {};

                  method getErrors

                  getErrors: () => ValidationError[];

                    method validateAll

                    validateAll: (data: any) => Promise<void>;

                      method validateAssetsAsync

                      validateAssetsAsync: (data: any) => Promise<void>;

                        method validateIcon

                        validateIcon: (iconPath: string) => Promise<void>;

                          method validateName

                          validateName: (name: string) => Promise<void>;

                            method validateProperty

                            validateProperty: (fieldPath: string, data: any) => Promise<void>;

                              method validateSchemaAsync

                              validateSchemaAsync: (data: any) => Promise<void>;

                                method validateSdkVersion

                                validateSdkVersion: (version: string) => Promise<void>;

                                  method validateSlug

                                  validateSlug: (slug: string) => Promise<void>;

                                    class SchemerError

                                    class SchemerError extends Error {}

                                      constructor

                                      constructor(errors: ValidationError[]);

                                        property errors

                                        errors: ValidationError[];

                                          property name

                                          readonly name: string;

                                            class ValidationError

                                            class ValidationError extends Error {}

                                              constructor

                                              constructor({
                                              errorCode,
                                              fieldPath,
                                              message,
                                              data,
                                              meta,
                                              }: {
                                              errorCode: ErrorCode;
                                              fieldPath: string;
                                              message: string;
                                              data: any;
                                              meta: any;
                                              });

                                                property data

                                                data: any;

                                                  property errorCode

                                                  errorCode: string;

                                                    property fieldPath

                                                    fieldPath: string;

                                                      property message

                                                      message: string;

                                                        property meta

                                                        meta: any;

                                                          property name

                                                          readonly name: string;

                                                            Type Aliases

                                                            type ErrorCode

                                                            type ErrorCode = keyof typeof ErrorCodes;

                                                              Package Files (2)

                                                              Dependencies (5)

                                                              Dev Dependencies (0)

                                                              No dev dependencies.

                                                              Peer Dependencies (0)

                                                              No peer dependencies.

                                                              Badge

                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@expo/schemer.

                                                              • Markdown
                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@expo/schemer)
                                                              • HTML
                                                                <a href="https://www.jsdocs.io/package/@expo/schemer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>