How to check confirm password with zod

You can achieve this by tacking on a superRefine export const registerUserSchema = z.object({ firstName: z.string(), lastName: z.string(), userName: z.string(), email: z.string().email(), phone: z.string().transform(data => Number(data)), password: z.string().min(4), confirmPassword: z.string().min(4), avatar: z.string().optional(), isVerified: z.boolean().optional() }).superRefine(({ confirmPassword, password }, ctx) => { if (confirmPassword !== password) { ctx.addIssue({ code: “custom”, message: “The passwords did not match” … Read more

Puppeteer not rendering color, background color when I try to save PDF on disk

Puppeteer is just a library to drive Chrome/Chromium, so if anything goes wrong while using it, our best bet is to open Chromium with puppeteer.launch({headless:false}) and debug there. Set your page css in <style></style> tag. You can solve the issue with the following CSS code: html { -webkit-print-color-adjust: exact; } p { color: #FF0000; }

node.js how to check a process is running by the process name?

You can use the ps-node package. https://www.npmjs.com/package/ps-node var ps = require(‘ps-node’); // A simple pid lookup ps.lookup({ command: ‘node’, psargs: ‘ux’ }, function(err, resultList ) { if (err) { throw new Error( err ); } resultList.forEach(function( process ){ if( process ){ console.log( ‘PID: %s, COMMAND: %s, ARGUMENTS: %s’, process.pid, process.command, process.arguments ); } }); }); … Read more

Unable to get Angular CLI version, though all the requirements are installed?

Angular CLI requires a current, active LTS, or maintenance LTS version of Node (https://angular.io/guide/setup-local#nodejs). which version 11 isn’t. Node.JS 11 is no longer supported by the Node.Js team as after six months, odd-numbered releases (9, 11, etc.) become unsupported. More info: https://nodejs.org/en/about/releases Solution : Upgrade Node version to 12+

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)