Giter Club home page Giter Club logo

express-zod-safe's Introduction

๐Ÿง‘๐Ÿปโ€๐Ÿ’ป Software Engineer

Interested in creating a new website? Need something automated?

๐ŸŒWebsites
โž•Web Extensions
๐Ÿ–ฅ๏ธDesktop Applications
๐Ÿ”งCLI Tools
๐Ÿ”ฎReverse Engineering

Checkout my portfolio to see what I've made!

๐Ÿ’ฌ Contact

Feel free to message me on through any of the methods below.

๐Ÿ“ง Email[email protected]
๐Ÿ’ฌ Discord@angablue

express-zod-safe's People

Contributors

angablue avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

express-zod-safe's Issues

Failed deployment

Hi!

Thanks for creating the package. Please review the dependabot triggered auto-deployment script, because it fails.

unrecognized_keys

router.post("/register", upload.single("picture"), validate(registerSchema), handleNewUser);

image

my schema :

// @ts-check

const z = require("zod");
const zu = require("zod_utilz");
const { stringNonEmpty, arrayFromString, formatPath } = require("@/utils/zodUtils");

//? -------- REGEX ---------
const passRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!#$%&*?@])[\d!#$%&*?@A-Za-z]{8,}$/;

//? -------- Sub Schema ---------
const credinalSchema = stringNonEmpty().trim().min(3).max(15);
const infoSchema = z.string().trim().min(3).max(15).optional();

const registerSchema = z.object({
	body: z.object({
		firstName: credinalSchema,
		lastName: credinalSchema,
		email: stringNonEmpty().email().trim().toLowerCase(),
		password: stringNonEmpty().min(8).max(15).regex(passRegex, "Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character (!$%&*?@#)"),
		location: infoSchema,
		job: infoSchema,
	}),
});

module.exports = { registerSchema };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.