Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Windows Tipps & SecurityNighthawk M7 Pro im Test: Flexibler, aber teurer 5G-Router(21.09.2026 um 10:30 Uhr)
Sichere ProgrammierungNeue Gmail-Funktion: So sparst du jetzt Zeit bei Einmalcodes(21.09.2026 um 10:00 Uhr)
Sichere ProgrammierungYour GIF exporter is fine — the container is the problem(21.09.2026 um 10:01 Uhr)
Sichere ProgrammierungCSS, Motion, or GSAP? I Choose by Who Owns the Animation(21.09.2026 um 10:12 Uhr)
Windows Tipps & SecurityNighthawk M7 Pro im Test: Flexibler, aber teurer 5G-Router(21.09.2026 um 10:30 Uhr)
Sichere ProgrammierungNeue Gmail-Funktion: So sparst du jetzt Zeit bei Einmalcodes(21.09.2026 um 10:00 Uhr)
Sichere ProgrammierungYour GIF exporter is fine — the container is the problem(21.09.2026 um 10:01 Uhr)
Sichere ProgrammierungCSS, Motion, or GSAP? I Choose by Who Owns the Animation(21.09.2026 um 10:12 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Build isXXX the Easy Way? Meet is-kit

Hey folks! The leaves are about to turn 🍁 I keep telling myself “just one more coffee”… but my hands are starting to shake ☕️😂 Anyway, I’m @nyaomaru, a frontend engineer.   Why I built this If you write TypeScript a lot, you’ve…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hey folks! The leaves are about to turn 🍁



I keep telling myself “just one more coffee”… but my hands are starting to shake ☕️😂

Anyway, I’m @nyaomaru, a frontend engineer.



 





Why I built this



If you write TypeScript a lot, you’ve probably hand-written type guards like value is Foo more times than you can count.

And keeping runtime checks perfectly aligned with types… kinda exhausting.



Enter is-kit — a lightweight, zero-dependency “guard generator kit” that slices through boring boilerplate ✂️





https://github.com/nyaomaru/is-kit



 





Why is-kit?




  • 🖋 Stop hand-writing value is Foo


    • Centralize guard definitions with define and predicateToRefine.



  • ⚙️ Compose logic with and / or / not


    • Express domain-specific conditions declaratively.



  • 🧩 Combinators like struct / array / tuple


    • Validate nested objects in just a few lines.



  • Runtime + type tests


    • Confidence via Jest (runtime) and tsd (type assertions).





 





How do I use it?



A super common case: “non-empty string” without hand-rolling the predicate signature.




import { define, isString } from 'is-kit';

const isNonEmptyString = define<string>(
(value) => isString(value) && value.length > 0
);

isNonEmptyString('foo'); // true
isNonEmptyString(''); // false






By passing the generic <string>, you don’t need to write the value is string predicate signature yourself — clean and tidy.



Another practical one: identifying a User shape.




import { struct, isString, isNumber, safeParseWith } from 'is-kit';

const isUser = struct({ id: isNumber, name: isString });

isUser({ id: 1, name: 'A' }); // true

const parseUser = safeParseWith(isUser);

const result = parseUser({ id: 'abc', age: 42 });
// result.valid === false

if (result.valid) {
// on success
} else {
// on failure
}






You can check whether API responses or form inputs satisfy your expected types safely.



For more complex conditions, compose:




import { and, or, not, predicateToRefine, isString, isNumber } from 'is-kit';

const isLongLiteral = predicateToRefine<string>((value) => value.length > 3);

const isLongString = and(isString, isLongLiteral);
isLongString('abcd'); // true
isLongString('ab'); // false
isLongString(123 as unknown); // false

or(isString, isNumber)('foo'); // true
not(isString)(123); // true






With the combinators + primitives/object guards, you can express a wide range of isXXX guards cleanly.



 






Install & Ecosystem



Install from npm:




pnpm add is-kit
# or
bun add is-kit
# or
npm i is-kit
# or
yarn add is-kit






Prefer JSR with Deno/Bun? Import TypeScript directly:




import { struct } from 'jsr:@nyaomaru/is-kit';






 






Wrap-up



is-kit is a small kit for writing safe TypeScript guards:





  • Keep it tiny with define


  • Model bigger shapes with struct


  • Combine complicated logic with and / or / not


  • Make ergonomics nice with safeParse / safeParseWith



If you’re tired of drift between types and runtime checks, drop is-kit into your project and give it a spin. 🚀



https://github.com/nyaomaru/is-kit



And if you like it, a ⭐ would make my day! 😻

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Build isXXX the Easy Way? Meet is-kit

Thematisch verwandte Begriffe: Build, isXXX, Easy, Meet · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94030 | A security vulnerability has been detected in SerenityOS up to 3d83e4509…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick