Skip to content

Instantly share code, notes, and snippets.

View omril1's full-sized avatar
🐣

Omri Luzon omril1

🐣
  • Autofleet
View GitHub Profile
@mathdroid
mathdroid / never.gif
Last active February 11, 2024 22:25
Never
never.gif
@wojtekmaj
wojtekmaj / jest-to-vitest.sh
Last active March 27, 2025 15:05
Automatically migrate Jest project to Vitest
#!/bin/bash
# Ensure we're working on the latest version of the main branch
git switch main
git fetch
git pull
# Create a new branch
git switch -c vitest
@ssalbdivad
ssalbdivad / ArkTypeVsZod.md
Last active May 1, 2025 14:42
ArkType/Zod Comparison

Here's a comparison between how the same simple user definition would be defined using ArkType and Zod:

image

ArkType's definition syntax is more concise (definitions are about 50% shorter on average) as well as making it more visually obvious what the inferred TypeScript type will be. The ability to infer TypeScript definitions directly is the same, but ArkType's syntax is again more concise by allowing you to use typeof on a property of arkUser directly instead of using an extra "infer" helper.

In general, we also have taken significant steps to optimize and clarify our type hints when hovering over validators. For example, in the case above, this is what you see when you mouse over "zodUser":

image

@rluvaton
rluvaton / type-check.mjs
Created January 31, 2024 16:44
TypeCheck only on typescript project files
import ts from 'typescript';
import path from 'node:path';
import Debug from 'debug';
const debug = Debug('type-check-only-project-files');
// ----------------------------------------------------------------
// This file is a helper file that can be used to run type check
// only for the files that in the project and not for any other file