正在加载视频...
视频加载失败
🔥 Built a smarter regex constructor this weekend 🔥 The output of `.exec` is inferred from capturing groups and it supports *named* groups too! Would you use it if this was open source? #TypeScript
47,970 次观看 • 3 年前 •via X (Twitter)
11 条评论

More features I could add: - check if your regex string is valid - automatically coerce number patterns like `[0-9]` to number - Add this to TS-Pattern?

Here is the code if you want to take a look (it's pretty complex) 👉

By the way, if you want to learn how I build this kind abstractions with smart type inference, you should read Type-Level TypeScript! It features a tom of free content + paid chapter for deep dive in more advanced concepts

Nice! I’ve been working on something similar for a while too, currently on third rewrite and almost done😂 two modes: infer all exact matched literal string or all possible matches as hint

It’s interesting to find that /t extends `${number}`, same goes to /r, /n…etc Any ideas? @mattpocockuk Thanks

@mattpocockuk That's definitely odd. Have you checked if there is an open issue about this?

that's some next-level type programming 😮👏

Yes! I teach how to do these kinds of things here (in case you don't already know)

🤯

I need this!!

Should I hit the npm publish button?
相关视频
Sensitive content
Send this via WhatsApp to your: • MP • Parents • Family & village groups • Church groups Then, accompany it with the screenshot from Revelation 13: 15 — and tell them this is the Mark of the Beast. Without it, no buying anything. Refuse. Reject. Resist. #ManDay
Eric
396,383 次观看 • 1 年前
Sensitive content
WAN 2.6 is live on ImagineArt. Uncensored, Unfiltered, Unrestrcited! 😬 This is that open source from Alibaba that makes you question “Is it even legal to use it?” Wan 2.6 generates video + audio together from a single prompt with up to 15 seconds output. RT + Like + Follow + Reply with “ImagineArt” and 5 people will get 1000 credits.
ImagineArt
836,978 次观看 • 6 个月前

