A frozen object rather than a TS enum, for size: a numeric enum emits a
reverse map (E[E.MODULE_NOT_FOUND = 1001] = "MODULE_NOT_FOUND"), so every
member's name ships twice — 1,007 B across these 19 members. Nothing looks a
name up from a code, so that half was dead weight. (const enum, which would
inline instead, is unavailable here: isolatedModules is on.)
The companion type alias keeps KernelErrorCode usable in type position
exactly as the enum was.
Error codes for kernel errors.
A frozen object rather than a TS
enum, for size: a numeric enum emits a reverse map (E[E.MODULE_NOT_FOUND = 1001] = "MODULE_NOT_FOUND"), so every member's name ships twice — 1,007 B across these 19 members. Nothing looks a name up from a code, so that half was dead weight. (const enum, which would inline instead, is unavailable here:isolatedModulesis on.)The companion type alias keeps
KernelErrorCodeusable in type position exactly as the enum was.