Configuring morphs in the scope/module level
I'm working on adding coercion to ArkEnv (issue with full context: https://github.com/yamcodes/arkenv/issues/228), since environment variables (in
process.env
) are always string | undefined
, we want to be able to coerce them.
Now:
```ts...Parsing nested form data
Hi lovely folks! Does ArkType have built-in support for parsing nested form data, e.g. parsing a set of fields like
address.street
, address.postcode
, etc into a schema address: { street: 'string', postcode: 'string', ... }
?Code generation from strings disallowed for this context
I am using cloudflare and its Vite plugin and am getting this error when using Arktype schemas.
Build works fine, preview/deployed fails on request with this message. It seems to be isolated to Cloudflare Vite plugin builds.
Idk if this thread helps any https://discord.com/channels/957797212103016458/1178476270879780944/1178476270879780944...
dynamic validation?
I have a schema like so:
```ts
export const blog = type({
headline: "string > 0",
description: "string > 0",...
Nested morphs not being applied
```typescript
import { type Out, Type, type } from 'arktype'
// import { Option } from 'ts-result-option'
class Option<T> {...
Cast empty string in place for literal as default value
Hi, I'm trying to use an array of string literals for a select field using Superforms. However, I would like to have the default value be an empty string, so that the default select field is not selected.
I've tried the following, but this doesn't seem to work
```ts...
Validating that a string isn't empty after trimming
Title says it all really. I want to have ArkType trim a string and then check its length, but
type("string.trim > 0")
doesn't work as the left side is a morph.arktype with isolatedDeclarations
If you have a package that uses
arktype
and isolatedDeclarations: true
in tsconfig.json
(for speed, OXC/tsdown support), then you'll likely see this error:
```ts
RollupError: TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
x TS9010: Variable must have an explicit type annotation with...JSDoc for keywords
Currently, we do not have JSDoc for built-in keywords (see image).
This seems to suggest adding JSDoc is not possible in the current api for keywords. Is that right, or is that something that can be done?
Asking because I'm curious to add JSDoc for my library (ArkEnv) that uses custom keywords....

Extending built-in keywords
Hey folks 👋
I’m building a cool tool that uses (and extends) ArkType, and I'm trying to figure out the right way to "extend" the default keywords (like
string
, number
, etc.) so they can have extra functionality/modules.
Here’s what I’ve tried:
...Is it possible to inferOut generics?
```typescript
export const tableWidgetSchema = type("<t>", {
records: "t[]",
});
...
Structure Node hinder DeepPartial
Hey, just stumbled across this amazing community and thought you might be able to help me. i was using a modified version of the deepPartial Function, that has been posted here
https://discord.com/channels/957797212103016458/957804102685982740/1348929382261067777
I have stumbled into an issue with certain type definitions:
...
Simple question re a function that returns a type:
Trying to create simple "factory" functions that make a type based on some other type. This works fine:
```const makeBar = <T1, T2>(inputs: Type<T1>, outputs: Type<T2>) => type({
weird: "boolean",
in: inputs,...
Can I make `string.yaml` like `string.json`?
I haven't been able to figure out a way of extending it with my own
yaml
https://arktype.io/docs/scopes#submodules 🤔How to merge types with Generics
I'm trying hard to understand how to work with generics (arktype and typescipt too).
```typescript
export const paginationRequest = <
const def extends object,...
Can Arktype create discriminated unions based on whether a key exists?
``` typescript
const MasterSkinItem = BaseItem.merge({
"+": "reject",
type: "'skin'",
masterItem: "true",...
examples of URLSearchParams
are there any examples of using arktype to turn URLSearchParams into a well formed, typed object?
I see things like Headers are supported as types, but didn't see URLSearchParams...
How to validate all properties without bailing early?
I am using Arktype to validate forms. I would like to show all problems with a form. I am using unions to show some form elements conditionally.
```
export const OtherPropertyRow = type.merge(
{...
How do I get the input type for `type`?
```ts
export function validateEnv<T extends Record<string, unknown>>(
def: ?,
) {
const schema = type(def)...