The type() function from arkenv always returns any when wrapping type definitions, which breaks type inference.
Current behavior:
import arkenv, { type } from "arkenv";
const env = arkenv({
TURSO_DATABASE_URL: type("string.url"), // types as 'any' instead of 'string'
});
Expected behavior:
The type() function should preserve the underlying type, so type("string.url") should result in a string type (not any).
Impact:
- Users lose type safety when using
type() wrapper
- Forces workarounds like type assertions or importing
type from arktype directly
- Only affects Bun, this does not happen in Node
Root cause identified: This issue occurs when tsconfig.json uses module: "commonjs". See #378 for the consolidated issue.
Related:
The
type()function from arkenv always returnsanywhen wrapping type definitions, which breaks type inference.Current behavior:
Expected behavior:
The
type()function should preserve the underlying type, sotype("string.url")should result in astringtype (notany).Impact:
type()wrappertypefromarktypedirectlyRoot cause identified: This issue occurs when
tsconfig.jsonusesmodule: "commonjs". See #378 for the consolidated issue.Related:
moduleResolution: "Node10"or"Node"in tsconfig #378 (root cause - TypeScript type errors withmodule: "commonjs")