#performance #typescript #node #javascriptTaming Timezones: Replacing moment.parseZone with @date-fns/tz and Vanilla JS DateTaming Timezones: Replacing moment.parseZone with @date-fns/tz and Vanilla JS Date How we preserved timezone-aware parsing when migrating from moment.js to date-fns and JS Date. One of the last pieces of work I completed at my last workplace was to migrate a core system from mome ...
#typescriptTypeScript in the Trenches: Utility types and type manipulation patterns for application development7 advanced types and patterns that I’ve used as part of TypeScript application development. These patterns help unlock new levels of type safety and maintainability in TypeScript. ...
#javascript #typescriptWhat is the "?." JavaScript/TypeScript operatorIn JavaScript and TypeScript, the “?.” operator is called optional chaining. It works in a similar fashion to the . (chaining) operator, except that it short-circuits instead of causing an error when a value is null or undefined. That means const obj = {}; console.log ...
#javascript #jsdoc #typescript #nodeHow to get type-checking and generate TypeScript Typing declaration (types.d.ts) from JSDoc annotationsHow to achieve TypeScript-like behaviour in Vanilla JavaScript using JSDoc and @ts-check in VSCode: that’s the purpose of this post. TypeScript is a JavaScript superset with types. It solves one of the big problems with JavaScript, which is “what parameters does this ...
#node #javascript #typescriptUse microbundle for a TypeScript npm moduleFor those looking to write a package and publish it to npm, TypeScript + microbundle is a low-friction way to build a high-quality library. I’ve created a GitHub repository template with microbundle, TypeScript, ava and xo. You can find it at github.com/HugoDF/microbundle-t ...