Begench Gurbanmammedovcalcucode.hashnode.dev·Dec 20, 2024Runtime Type Checking with Zod in a front-end applicationTypeScript helps developers resolve common problems in web development by ensuring type safety. TypeScript performs type checking during compilation, allowing developers to catch potential issues early. However, when consuming data from external serv...Frontend Development
Jesicajestsee.hashnode.dev·Dec 14, 2024Setting Dynamic Default Values with Zod SchemaIntroduction Zod provides a powerful way to define schemas for validating and transforming data. You can easily define default values for properties. but what if you need a default value based on another property in the schema? Let’s explore how to...zod
Panth Patelhow-is-my-backend.whiteloves.in·Dec 8, 2024How to Implement Type Safe Functions in JavaScriptEver run into the issue where you can't make type-safe functions in JavaScript? So you switch to TypeScript, only to find out that types are just for development and don't actually validate function inputs or outputs! Then you end up using a validati...dispose
Abhishek Rautsweabhishek.hashnode.dev·Dec 8, 2024Middleware in Express: Keep Your Server Chill with Global Error Handling and Zod 😎What’s Middleware? When you're building APIs or web apps in Express.js, middleware is like that homie who handles all the important tasks before you even get to the fun part (your routes). 🚀 Whether it’s parsing JSON, checking if a user is logged in...js
Luca Restagnolucarestagno.hashnode.dev·Dec 3, 2024How to validate your Next.js API with Zod and TypescriptNext.js is a popular React framework known for building end-to-end web applications. It enables developers to manage both the front-end and back-end of a project within a unified codebase, simplifying development and maintenance. When building web AP...Web Development
Panth Patelhow-is-my-backend.whiteloves.in·Dec 1, 202410 Common Issues in Node.js to keep in MindIf you have a callback API function, fix it using the Promise constructor. function badImplementation() { return new Promise((resolve, reject) => { someOldLibWithCb((data, err) => { if (err) { reject(err); ...Node.js
Landaylanday.hashnode.dev·Nov 25, 2024使用zod时的注意:nullable vs optional定义zod schema的时候,有时候定义为nullable时要注意:如果你是从一个可能为空的对象里取出一个字段来parse的时候,可能会出现问题: const schema = z.object({ a: z.string().nullable() }); const rawData = { nested: null }; const data = schema.parse({ a: rawData.nested?.a }); 会导致throw,程序无法继续下去。 解决办法:...zod
Pawan Gangwaniblogs.pgangwani.co.in·Nov 14, 2024Type-Safe React: Leveraging TypeScript and Zod for Better ApplicationsTypeScript and Zod together create a powerful combination for building type-safe React applications. While TypeScript provides static type checking, Zod adds runtime validation and automatic type inference. Let's explore how to effectively use these ...TypeScript
Emmanuel Obeng Twenedelinuxist.hashnode.dev·Oct 29, 2024Step-by-Step Guide to Fullstack Development with Next.js and Lucia AuthenticationIntroduction Authentication and authorization are crucial components of web security, ensuring that users can securely access resources within an application. Authentication is the process of verifying a user’s identity, while authorization determine...28 readsfrontend
Kceekcee.hashnode.dev·Oct 18, 2024Enhance Your Express Applications with Zod LibraryExpress.js is a great framework for building web applications. It offers flexibility, and ease of use whilst being very robust. In this article, we will use Zod to enhance the features of a web API built with Express. Zod is a schema validation libra...API development