From 425a7bc6e70ca14542cc43b6ebe258b1a6596744 Mon Sep 17 00:00:00 2001 From: robonen Date: Mon, 15 Jun 2026 16:54:50 +0700 Subject: [PATCH] refactor(stdlib): replace source any with unknown/generics Type guards take `unknown`; walkers/comparators (get/set/isEqual) narrow via casts; generic defaults and constraints tightened. Truly-idiomatic any-function constraints and load-bearing type-level any are kept with explanatory comments. --- core/stdlib/docs/intro.vue | 42 ++++++++-------- core/stdlib/eslint.config.ts | 4 +- core/stdlib/src/arrays/zip/index.ts | 2 +- core/stdlib/src/async/pool/index.ts | 6 ++- core/stdlib/src/async/retry/index.ts | 8 +-- core/stdlib/src/async/tryIt/index.ts | 8 +-- core/stdlib/src/collections/get/index.ts | 13 +++-- core/stdlib/src/collections/set/index.ts | 4 +- core/stdlib/src/comparators/isEqual/index.ts | 4 +- core/stdlib/src/functions/compose/index.ts | 16 +++--- core/stdlib/src/functions/pipe/index.ts | 16 +++--- .../patterns/behavioral/StateMachine/async.ts | 3 ++ .../patterns/behavioral/StateMachine/sync.ts | 3 ++ .../patterns/behavioral/StateMachine/types.ts | 2 +- core/stdlib/src/structs/BinaryHeap/index.ts | 5 +- core/stdlib/src/types/js/casts.ts | 4 +- core/stdlib/src/types/js/complex.test.ts | 1 - core/stdlib/src/types/js/complex.ts | 50 +++++++++---------- core/stdlib/src/types/js/primitives.ts | 33 ++++++------ core/stdlib/src/types/ts/collections.ts | 5 +- core/stdlib/src/types/ts/function.ts | 2 + 21 files changed, 124 insertions(+), 107 deletions(-) diff --git a/core/stdlib/docs/intro.vue b/core/stdlib/docs/intro.vue index 5d54ef1..f00243d 100644 --- a/core/stdlib/docs/intro.vue +++ b/core/stdlib/docs/intro.vue @@ -30,7 +30,7 @@ if (error) {

@robonen/stdlib

-

+

A platform-independent standard library of tools, utilities, and helpers for TypeScript — arrays, async, math, data structures, and patterns, all tree-shakeable and fully typed.

@@ -48,30 +48,30 @@ if (error) {
-
-

Fully typed

-

+

+

Fully typed

+

Generic signatures preserve element and key types end to end, so inference keeps working through groupBy, partition, zip, and friends.

-
-

Zero dependencies

-

+

+

Zero dependencies

+

No transitive dependencies and no platform assumptions. The same code runs in Node, the browser, Deno, Bun, and edge runtimes.

-
-

Tree-shakeable

-

+

+

Tree-shakeable

+

Each utility is a standalone export with no shared side effects. Import a single function and ship only that function.

-
-

Batteries included

-

+

+

Batteries included

+

Beyond array and math helpers you get data structures (Deque, BinaryHeap, LinkedList) and patterns (StateMachine, PubSub, Command). @@ -126,16 +126,16 @@ if (error) {

-
-

Where to next

-

+

+

Where to next

+

Browse the full API reference below, or jump straight to a popular utility: