Andrew Jarrett
@ahrjarrett.bsky.social
13 followers 11 following 14 posts
Working on https://github.com/traversable/schema
Posts Media Videos Starter Packs
Pinned
ahrjarrett.bsky.social
Writing tests is hard, and I'm lazy. I'd rather write a few invariants, and let fast-check fuzz test the rest.

That's why I built @​traversable/valibot-test.

Here it is in action:
ahrjarrett.bsky.social
100 stars and 100,000 all-time downloads on the same weekend :)

A library is nothing without its users. Thank you for using my software 🙏❤️
ahrjarrett.bsky.social
Here's are some resources on property testing/fuzz testing that I've been reading lately:

- Property testing in Elixir: propertesting.com
- How to identify properties/invariants: fsharpforfunandprofit.com/series/prope...
- Using fast-check with Cypress: www.youtube.com/watch?v=E42T...

Any others?
ahrjarrett.bsky.social
Interesting article by @chrispenner.ca about why monads aren't the solution to everything, and a functor I've never crossed paths with called selective applicatives.

Still absorbing it, but great read as always. Check it out if that's your thing.

chrispenner.ca/posts/expres...
Monads are too powerful: The Expressiveness Spectrum
Monads are a useful tool, but what costs do we pay for their expressive power?
chrispenner.ca
ahrjarrett.bsky.social
This afternoon I was listening to @typescript.fm and was surprised to hear @​traversable/valibot mentioned 🤩

As a long time fan of the podcast, this was super fun.
Reposted by Andrew Jarrett
iamkale.millerti.me
This is great news! GitHub will require use of passkeys for 2FA when publishing to NPM. What a huge step up in security compared to other phishable 2FA methods that were historically supported 🎉

github.blog/security/sup...
Our plan for a more secure npm supply chain
GitHub is strengthening npm's security with stricter authentication, granular tokens, and enhanced trusted publishing.
github.blog
ahrjarrett.bsky.social
What if deep object comparisons were 10x more performant than they've ever been in JavaScript?

Just re-use your Valibot, ArkType, Zod, or TypeBox schema. It even works with JSON Schema.

Run the benchmarks yourself:
bolt.new/~/mitata-ej4...

Library:
github.com/traversable/...
ahrjarrett.bsky.social
Ah, I had more cases, but ended up removing most of them 😅 this could probably be simplified to an if/else.

Glad you got something from it! TypeScript added support for narrowing in switch/true kinda recently:

www.typescriptlang.org/docs/handboo...
Documentation - TypeScript 5.3
TypeScript 5.3 Release Notes
www.typescriptlang.org
ahrjarrett.bsky.social
I also think the implementation is interesting. The workhorse here is the fold function – all 29 libraries are powered by the same abstraction.
ahrjarrett.bsky.social
Here's the encode step:
ahrjarrett.bsky.social
Just shipped a zod transformer that turns a zod schema into a recursive to/from snake/camel case codec.

This release also allows users to provide their own key to/from transforms.

Available in @​traversable/[email protected].

Feedback welcome! cc @colinhacks.com
ahrjarrett.bsky.social
Writing tests is hard, and I'm lazy. I'd rather write a few invariants, and let fast-check fuzz test the rest.

That's why I built @​traversable/valibot-test.

Here it is in action:
Reposted by Andrew Jarrett
fabianhiller.com
This is one of the coolest @valibot.dev utility libraries around! 🔥

It can convert Valibot schemas into stringified TypeScript types. It can also check schemas for equality and clone them. Great job, @ahrjarrett.bsky.social! 🪄

Read the full article on @dev.to: dev.to/ahrjarrett/i...
Introducing: @traversable/valibot
A few weeks ago I released a TypeScript library called @traversable/valibot. This post covers what...
dev.to