Skip to main content
Home
This release is 1 version behind 0.0.49 — the latest version of @skmtc/gen-arktype. Jump to latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
0%
Published
4 weeks ago (0.0.48)
Package root>src>ArktypeInsertable.ts
import { type TypeSystemValue, type GenerateContextType, type RefName, type ContentSettings, Identifier } from 'jsr:@skmtc/core@^0.0.974' import { toArktypeValue } from './Arktype.ts' import { ArktypeBase } from './base.ts' import type { EnrichmentSchema } from './enrichments.ts' type ConstructorArgs = { context: GenerateContextType destinationPath: string refName: RefName settings: ContentSettings<EnrichmentSchema> rootRef?: RefName } export class ArktypeInsertable extends ArktypeBase { value: TypeSystemValue constructor({ context, refName, settings, destinationPath, rootRef }: ConstructorArgs) { super({ context, refName, settings }) const schema = context.resolveSchemaRefOnce(refName, ArktypeBase.id) this.value = toArktypeValue({ schema, required: true, destinationPath, context, rootRef }) } static schemaToValueFn = (...args: Parameters<typeof toArktypeValue>) => { return toArktypeValue(...args) } static createIdentifier = Identifier.createVariable override toString() { return `${this.value}` } }