News for hackers. Stuff that matters.
Re:TIL: `satisfies` is my favorite TypeScript keyword by miki123211 on Saturday November 22, 2025 @06:43PM (#46019380)
I recently had to write a Promise.all, but using an object instead of an array.

That was... non-trivial.

Re:TIL: `satisfies` is my favorite TypeScript keyword by hdjrudni on Saturday November 22, 2025 @07:20PM (#46019566)
If it's what I'm thinking, that one isn't too bad. I wrote it awhile back:

    export async function promiseAll<T extends Record<string, Promise<any>>>(promises: T): Promise<{ [K in keyof T]: Awaited<T[K]> }> {
        const keys = Object.keys(promises) as Array<keyof T>;
        const result = await Promise.all(keys.map(key => promises[key]));
        return Object.fromEntries(result.map((value, i) => [keys[i], value])) as { [K in keyof T]: Awaited<T[K]> };
Re:TIL: `satisfies` is my favorite TypeScript keyword by atsjie on Sunday November 23, 2025 @02:34AM (#46021549)
I'd call that bad pretty bad.

Without internet or AI I wouldn't attempt writing anything like that.

Re:TIL: `satisfies` is my favorite TypeScript keyword by ruined on Saturday November 22, 2025 @08:21PM (#46019883)