‘“one” | “two” | string’ autocomplete TypeScript trick
Have you ever wanted to suggest some strings but still allow any string? Like "GET" | "POST" | string? But then it just doesn't work like you want it to?
A far too meticulous web developer 💻
Have you ever wanted to suggest some strings but still allow any string? Like "GET" | "POST" | string? But then it just doesn't work like you want it to?
The official Node.js docs (v25.2.1) say that process.platform can be 'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' and process.arch can be 'arm' | 'arm64' | 'ia32' | 'loong64' | 'mips' | 'mipsel' | 'ppc64' | 'riscv64' | 's390' | 's390x' | 'x64'. That's not quite true. This is my chronicle for future me.
I did some diving into what the possible values for these string enums are:
TODO: Add images
Make this in a bread maker. 1.5 lb loaf. "Regular" settings on bread maker.
TODO: Add images
TODO: Add images
This is very vague. Use whatever amount looks good.
TODO: Add images
Here's the code: