This is the Modern Typescript Documentation. Are you looking for the Classic Documentation ? Sponsorship ♡ If you value the hard work behind Orange and wish to see it evolve further, consider sponsoring. Your support fuels the journey of refining and expanding this tool for our developer community. Installation import orange from 'orange-orm'; const map = orange.map(x => ({ customer: x.table('cust
In this blog post, we explore how we can test that complicated TypeScript types work as expected. To do that, we need assertions at the type level and other tools. Asserting at the type level # Writing more complicated types is like programming at a different level: At the program level, we use JavaScript – e.g.: Values Functions with parameters At the type level, we use (non-JavaScript) TypeScri
TypeScript’s satisfies operator lets us check the type of a value (mostly) without influencing it. In this blog post, we examine how exactly it works and where it’s useful. Notation used in this blog post # For showing computed and inferred types in source code, I use the npm package asserttt – e.g.: // Types of values assertType<string>('abc'); assertType<number>(123); // Equality of types type
Update 2025-01-29: --erasableSyntaxOnly is available in TypeScript 5.8 Beta. Update 2025-01-09: Added the section “A few random thoughts”. Starting with v23.6.0, Node.js supports TypeScript without any flags. This blog post explains how it works and what to look out for. Would you rather jump right in and explore? # Then take a look at my GitHub repository nodejs-type-stripping. A first look at t
By: Michael Mitchell, Patrick Hayes We previously wrote about how Airtable migrated its codebase from Flow to TypeScript. A few years and several TypeScript versions later, TypeScript is still a critical tool for preventing bugs early on in the development cycle. Back when the previous article was written, we had just over 50 TypeScript projects — mostly mirroring the top-level directory structure
What can Zig learn from TypeScript, and what can TypeScript learn from Zig? The Advent of Code is a fun annual programming competition with an Elf theme. It consists of 25 two-part problems of increasing difficulty, released every day in December leading up to Christmas. Every December, I complete it in a new programming language. Every January, I intend to blog about the experience. Usually this
Unbeknownst to many, the new isolatedDeclaration feature shipped in TypeScript 5.5 is much more important than you might realize. It just revolutionized how we package and distribute JavaScript code. You don't need to create *.d.ts files manually anymore by invoking the tsc compiler. "Go to source" (the thing when you do ctrl+click or cmd+click on macOS) actually works now and it leads you right t
EDIT: A previous version of this post recommended publishConfig, operating under the mistaken belief that it could be used to override "exports" during npm publish. As it turns out, npm only uses "publishConfig" to override certain .npmrc fields like registry and tag, whereas pnpm has expanded its use to override package metadata like "main", "types", and "exports". There are a number of reasons y
Contents Introduction Issue Solution Introduction Branded types in TypeScript enable the creation of new types by affixing a type tag to an existing underlying type. This tag, commonly referred to as the "brand", distinguishes values of the branded type from others sharing the same underlying type. Acting as a compile-time validator, the brand ensures that values are utilized correctly within thei
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く