RSSAmplifier

Blog

culi.bear.blog

Hey, I'm Culi! I write code and sometimes blog posts maybe kinda sorta hopefully sometimes....

culi.bearblog.devRSS feed ↗2 posts

Latest posts

JSDoc is TypeScript

In May of 2023 an internal refactoring PR from the Svelte repo made it to the front page of the Hacker News forums. The (superficially) controversial PR seemingly vindicated TypeScript skeptics/luddites (which at the time included figures like Dan Abramov of the React team). The premier darling of web frameworks ostensibly rejecting the benefits of static typing was a big deal. 1 So Rich Harris…

Implementing Ruby's `.dig` Hash method in TypeScript

What's .dig ? Ruby hashes have a .dig method that allows us safely access a nested value in a Hash. h = { foo : { bar : { baz : 12 } } } puts h . dig ( :foo , :bar , :baz ) # 12 puts h . dig ( :foo , :qux , :baz ) # nil (no Error) Expand this to see how other languages do it. This plays a similar role to JavaScript's optional chaining . h ? . foo ? . bar ? . baz ; // 12 h ? . foo ? . qux ? . baz ;…