I'm looking for my next role 👀
TS SDKs, DX, agent tooling. remote/hybrid from Boston.
if you've enjoyed ArkType, Standard Schema or my TypeScript perf work, a repost would mean a ton 🙏
ssalbdivad.com
📢ArkType 2.2 is here.
This is a big one, and it's long overdue.
Validated functions, type-safe regex, bidirectional JSON Schema, and universal schema interop.
Here's what's new 🧵
@ark/json-schema — Bidirectional JSON Schema
Parse JSON Schema into ArkType Types, and convert Types to JSON Schema. Huge thanks to @TizzySaurus for building this one.
toJsonSchema() now supports configurable fallbacks, draft-07/2020-12 targets, and cyclic types. 11 granular fallback codes for handling incompatibilities your way.
all you need to "learn" ArkType syntax:
1️⃣ start with a typescript keyword
2️⃣ .autocomplete to discover constraints
3️⃣ compose if needed with &, |, etc.
@repalash There is a fluent style available as well, but type-safe strings like this can offer more readability, concision and parallel TypeScript 1:1 for situations where they're a good fit like this.
Autocomplete + type-level errors make a big difference.
@repalash By default will be inferred by TS but when introspectability is needed currently it is specified with a `:` to mirror a return type annotation in TS.
Considering "=>" instead which could also be a good fit (will finalize as part of 2.2 release).
for object definitions, you can either use a Scope if you want to string embed everything by referring to custom aliases:
arktype.io/docs/scopes
use `.at` to narrow on specific properties:
arktype.io/docs/match#nar…
or use .case chaining to pass object definitions directly:
arktype.io/docs/match#flu…
there is no ability yet in arktype to define comparison behavior for custom types although it sounds like from what you're describing you wouldn't need it because these would still be numbers.
249 Followers 871 FollowingI build AI + full-stack apps and share the messy, real process. Follow for practical dev tips, project breakdowns & tools you can use.
2 Followers 98 FollowingA full stack web developer proficient in the MERN stack, Next.js, JavaScript, and TypeScript, with experience solving DSA problems using Python.
424K Followers 49 FollowingTypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.