Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

casperiv0/utils

Repository files navigation

@casper124578/utils

A package with useful node util functions (mostly for my personal projects)

Example

ts example

import * as yup from "yup";
import { validateSchema } from "@casper124578/utils";

const testSchemaObj = {
  email: yup.string().required().email(),
  password: yup.string().required().min(8),
};

// later in the code
const data = {
  /* some data here */
};

const [error] = await validateSchema(testSchemaObj, data);

if (error) {
  return console.log("validation error!", error);
}

console.log("validation success!");

Releases

No releases published

Sponsor this project

Packages

No packages published