News for hackers. Stuff that matters.
Re:Routes don't look flat enough to me by dgreensp on Tuesday February 14, 2023 @03:12AM (#34786775)
Simple, readable, type-checked code in TypeScript: https://www.typescriptlang.org/play?target=6#code/C4TwDgpgBA...
Re:Routes don't look flat enough to me by Spivak on Tuesday February 14, 2023 @09:54AM (#34790153)
To have parity with the original article, now do it without recursion / bounded stack depth because you're worried that your data might blow out the stack.
Re:Routes don't look flat enough to me by dgreensp on Tuesday February 14, 2023 @08:51PM (#34799042)
I thought about it, but it's just so unmotivated in this case. URLs would have to be hundreds of path segments long.
Re:Routes don't look flat enough to me by winrid on Wednesday February 15, 2023 @02:18AM (#34800973)
That's not a solution because you manually turned the input into a valid TS array. You also manually turned the method names into strings, and they aren't in the input... that's part of the fun :)