Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "// @ts-nocheck" #14

Open
nightness opened this issue Aug 16, 2023 · 0 comments
Open

Fix for "// @ts-nocheck" #14

nightness opened this issue Aug 16, 2023 · 0 comments

Comments

@nightness
Copy link

nightness commented Aug 16, 2023

Bug description

// @ts-nocheck suppresses errors

oneOfSchemas.helper.ts

import * as Yup from "yup";
declare module "yup" {
  interface MixedSchema {
    oneOfSchemas(schemas: Array<Yup.Schema<any>>): this;
  }
}
Yup.addMethod<Yup.MixedSchema>(
  Yup.mixed,
  "oneOfSchemas",
  function (schemas: Array<Yup.Schema<any>>) {
    return this.test(
      "one-of-schemas",
      "Not all items in [object Object] match one of the allowed schemas",
      (item) =>
        schemas.some((schema) =>
          schema.isValidSync(item, {
            strict: true,
          })
        )
    );
  }
);

How to reproduce

Not applicable

Expected behavior

No response

Prisma information

Not Applicable

Environment & setup

  • All

Prisma Version

Not Applicable

@nightness nightness reopened this Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant