????? ?????? ??? ??? ???? API ??? ?? ??? ???? ?? ??? ?? ??? ????. ??? ?????. ????? ?? ??? ???? ?? ?? ?? ??? ???? ??? ????. ?, ??? ?????? ??? ??? ?? ??? ????? ?????.
??? ???? ? ?? ??? ?? ? ????. ? ???? ?? ??? ?? ?? ??? ?? ???? ??? ??? ? ?? ?? ? ??? ????. ? ?? ??? ?? ??? mock? ?? ???? ? ??? ????. ?? ?? ???? ??? ?? ??? ?? ?? ?? ??? ??? ??? ???? ??? ???? ? ????.
?? ???? ?? ????? ?? ? ?? ?? ???? ????.
type Order = { orderId: string; customerInfo: CustomerInfo; // omitted these types for brevity orderDate: string; items: OrderItem[]; paymentInfo: PaymentInfo; subtotal: number; shippingCost: number; tax: number; totalAmount: number; status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled'; trackingNumber: string | null; }; const mockOrders: Order[] = [ { orderId: "ORD-2024-001", customerInfo: { id: "CUST-1234", name: "Alice Johnson", email: "alice.j@email.com", shippingAddress: { street: "123 Pine Street", city: "Portland", state: "OR", zipCode: "97201", country: "USA" } }, orderDate: "2024-03-15T14:30:00Z", items: [ { productId: "PROD-789", name: "Organic Cotton T-Shirt", quantity: 2, pricePerUnit: 29.99, color: "Navy", size: "M" }, { productId: "PROD-456", name: "Recycled Canvas Tote", quantity: 1, pricePerUnit: 35.00, color: "Natural" } ], paymentInfo: { method: "credit_card", status: "completed", transactionId: "TXN-88776655" }, subtotal: 94.98, shippingCost: 5.99, tax: 9.50, totalAmount: 110.47, status: "shipped", trackingNumber: "1Z999AA1234567890" }, // Imagine more objects here, with various values changed... ];
?? ?? ???? ???? ?? ??? ?? ???. ?? ??? ??? ??? ??? ???, ?? ? ??? ??? ? ??? ?? ??? ?? ???? ?? ?? ?? ?? ??? ?? ?? ?????.
??? ?? ??? ?? ???? ??????? ?? ???? ??? ?? ?????? '?? ???? ? ?? ??? ??????'?? ??? ? ????. ?? ?? ?? ?? ?? ??? ?????? ? ??? ??? ???? ??? ? ?? ??? ?? ?????.
??????? ? ??? ?? ??? ??? ?? ?? ??? ???? ??? ?? ?????. ?? ?? ??? ? ??? ? ?? ??? ? ??? ????? ????? ????? ??? ???? ??? ????
?? ??? Zod?? ?????? ??? ??? ??? ??? ?? ?? ???? ???? ???? ?? ????? ?? ???? ??????.
const stringSchema = z.string(); stringSchema.parse("fish"); // => returns "fish" stringSchema.parse(12); // throws error
??? ??? ???????. Zod ??? ?? ? ?? ?? ?? ?? ?? ? ?????! ?? ?? ???? ?? ????? ??? ? ?? ?? ?? ???? ?? ?????. ?? Zod ???? ???? ??? ? ??? ?? ?? ?? ?????. ? ??? ???? ?? ?? ?? ?? ??? ????? ??? ???? ??, ???. Zod ???? ???? ???? ???? ??? ? ????.
const UserSchema = z.object({ id: z.string().default('1'), name: z.string().default('Craig R Broughton'), settings: z.object({ theme: z.enum(['light', 'dark']), notifications: z.boolean() }).default({ theme: 'dark', notifications: true, }) }); const user = UserSchema.parse({}) // returns a full user object
?? ??? ??? ? ?? ??? ???? ??? ?? ?? ?? ??????. ?? ?? ??? ?? ?? '??'? ??? ? ???? ?? ???????. ??? ???? ??? ????.
const UserSchema = z.object({ id: z.string().default('1'), name: z.string().default('Craig R Broughton'), settings: z.object({ theme: z.enum(['light', 'dark']), notifications: z.boolean() }).default({ theme: 'dark', notifications: true, }) }); const user = UserSchema.parse({}) const overridenUser = {...user, ...{ name: "My new name", settings: {}, // I would need to write every key:value for settings :( } satisfies Partial<z.infer<typeof UserSchema>>} // overrides the base object
??? ???? ???? ??? ????. ?????? ? ??? ????? ???? ??? ???? ?? ?? ?? ??? ?? ???? ???? ???? ?? ??? ???? ? ?? ???? ???? ???, ?? ?? ?? ???? ??? ?????.
?? ???? ?? ??? ???? ?? ? ?? ??? ?? ???? ??? ?? ?? ??????. ? ?? ??? 'API'? ???? ??????. ???? ? ??? ??? ?? ????? ??????
type Order = { orderId: string; customerInfo: CustomerInfo; // omitted these types for brevity orderDate: string; items: OrderItem[]; paymentInfo: PaymentInfo; subtotal: number; shippingCost: number; tax: number; totalAmount: number; status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled'; trackingNumber: string | null; }; const mockOrders: Order[] = [ { orderId: "ORD-2024-001", customerInfo: { id: "CUST-1234", name: "Alice Johnson", email: "alice.j@email.com", shippingAddress: { street: "123 Pine Street", city: "Portland", state: "OR", zipCode: "97201", country: "USA" } }, orderDate: "2024-03-15T14:30:00Z", items: [ { productId: "PROD-789", name: "Organic Cotton T-Shirt", quantity: 2, pricePerUnit: 29.99, color: "Navy", size: "M" }, { productId: "PROD-456", name: "Recycled Canvas Tote", quantity: 1, pricePerUnit: 35.00, color: "Natural" } ], paymentInfo: { method: "credit_card", status: "completed", transactionId: "TXN-88776655" }, subtotal: 94.98, shippingCost: 5.99, tax: 9.50, totalAmount: 110.47, status: "shipped", trackingNumber: "1Z999AA1234567890" }, // Imagine more objects here, with various values changed... ];
? API? ???? ???? ??? ??? ???? ??? ?? ??? ???? ???? ??? ??? ??? ? ????. ?? ??? ?? ???? ??? ??? ???? ???? ????. ?? ???? ???? ??? ??? ?? ??? ?? ????? ????? ?? ???????.
const stringSchema = z.string(); stringSchema.parse("fish"); // => returns "fish" stringSchema.parse(12); // throws error
? ??? ??? ??? ??? ????? ?? ????? ?? ??? ?????? ???? ???? ?????? Zods ?? ?? ??? ?? ??? ??? ? ??? ????. ??? if/else ?? ?? ??? ? ??? ? ?? ?? ???? Zod ???? ??? ???? ???? ?? ?? ??? ???? ??? ?? ? ??? ???? ??? ??????.
? ??? ???? ??? ??? ????? ????? ???? ??? ??? ? ????.
const UserSchema = z.object({ id: z.string().default('1'), name: z.string().default('Craig R Broughton'), settings: z.object({ theme: z.enum(['light', 'dark']), notifications: z.boolean() }).default({ theme: 'dark', notifications: true, }) }); const user = UserSchema.parse({}) // returns a full user object
preservedNestedDefaults ?? ??? ??? ???? ???? ??? ?? ?? ?? ??? ? ? ?? ??? ? ????! ?? ???? ?? ?? ??? ?? ? ??? ??? ?? ???? ????? ??? ???? ?????? ??? ?? ??? ?? ?? ?????.
?? ? ?? ???? ??? ??? ??? ????????. ? ?? ?? ??? ?? ???? zodObjectBuilder? ???? ?? ???? ??? ???????. ?? ??? ???? ???? ?? ???? zodObjectBuilder? ?????.
const UserSchema = z.object({ id: z.string().default('1'), name: z.string().default('Craig R Broughton'), settings: z.object({ theme: z.enum(['light', 'dark']), notifications: z.boolean() }).default({ theme: 'dark', notifications: true, }) }); const user = UserSchema.parse({}) const overridenUser = {...user, ...{ name: "My new name", settings: {}, // I would need to write every key:value for settings :( } satisfies Partial<z.infer<typeof UserSchema>>} // overrides the base object
? ????? ?? ???? ???? ?? ??? ?????! ??? ??? ? ?? ?? ? ? ????. ?? (? ?? ???? ??? ?? ?? ??? ??) ?? API ?? ?? ??? ??? ?? ??? ??? ? ????.
const UserSchema = z.object({ id: z.string().default('1'), name: z.string().default('Craig R Broughton'), settings: z.object({ theme: z.enum(['light', 'dark']), notifications: z.boolean() }).default({ theme: 'dark', notifications: true, }) }); const user = zodObjectBuilder({ schema: UserSchema, overrides: { name: 'My new name', settings: { theme: 'dark' } } // setting is missing the notifications theme :( }); // returns a full user object with the overrides
?? ?? ??? ?? ??? ???? ?? ????? ?????! ??? zodObjectBuilder ??? ??? ? ?? ?? ?? ???? ???? ??? ?? ??? ???? ? ??? ??? ???? ? ?? ??? ????? ????.
? ?? ???? ? ?? ??? ????? :) ?? ??? ?? ?? ??? ???? ????? ????. zodObjectBuilder? ?? ?? ???? ?? ??? ????? ?? ? ?? ??? ? ???? ????. ?? ??? ??? ?? ??? ?? ??? ??? https://www.npmjs.com/package/@crbroughton/ts-utils?? ?? ? ????.
? ??? Zod? ???? ??? ???? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

TAGGSATTHEBOTTOMOFABLOGPOSTORWEBPAGESERVESPRACTICALPURSEO, USEREXPERIENCE, andDESIGN.1.ITHELPSWITHEOBYOWNSESPORENGENSTOESTOCESKESKERKESKERKERKERDER-RELEVANTTAGSWITHOUTHINGTEMAINCONTENT.2.ITIMPROVESEREXPERKEEPINGTOPONTEFOCUSOFOFOFOCUSOFOFOFOCUCUSONTHEATECLL

??? ?? ? ??? DOM?? ??? ??? ? ?????. ??? ?? ????? ?? ??????, ??? ?? ???? ?? ????????. 1. ??? ??? addeventListener? usecapture ?? ??? true? ???? ?????. 2. ??? ??? ?? ???? usecapture? ???? ????? ?????. 3. ??? ??? ??? ??? ???? ? ??? ? ????. 4. ??? ?? ?? ?? ??? ?? ??? ??????? ??? ???? ?????. 5. ??? ?? ?? ?? ??? ?? ???? ?? ???? ? ??? ? ????. ? ? ??? ???? ???? JavaScript? ??? ??? ??? ????? ???? ???? ??? ??????.

ES ??? CommonJS? ?? ???? ?? ?? ? ?? ???????. 1. Commonjs? ????????? Node.js ?? ? ??? ?????. 2.ES ??? ???????? ????? ?? ???? ??? ?????. 3. ??, ES ??? ?? ??/????? ???? ??? ??? ?????? CommonJS? Quiew/Module.exports? ???? ???? ???? ?? ? ? ????. 4. Commonjs? Express? ?? ???? Node.js ? ?????? ?? ???? ?? ???? ?? ES ??? ?? ??? ?? ??? ?? ? Node.jsv14? ?????. 5. ?? ? ? ??? ?? ??? ??? ? ????.

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

VAR, Let ? Const? ???? ??, ?? ? ?? ?????. 1.var? ?? ??????? ?? ???? ?? ? ??? ?????. 2. let? ?? ?? ????? ?? ?? ???? ?? ? ??? ???? ????. 3. ???? ?? ?? ???? ?? ??????? ? ?? ? ? ??? ?? ??? ?? ?? ??? ? ????. ?? const? ???? ??? ??? ? LET? ???? VAR? ???? ????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

DOM Traversal? ? ??? ?? ??? ?????. ???? ???? ??? ?????. 1. ParentNode? ???? ?? ??? ?? ???? ?? ? ????. 2. ???? ?? ?? ??? ???? ??? ?? ? ?? ?? ?? ??? ??? ??????. 3. NextElementsibling? ?? ?? ??? ?? ?? ??? ???? ??? ??? ??? ?????. ???? ?? ??, ??? ?? ?? ?? ?? ?? ????? ??? ???? ?? Brother ??? ?? ?????. ??? ??? ??? ? ??? ??? ??? ???? ?? ? ? ????.
