INNER CODE UNIT · TypeScript

GOptional

stepci/garph · src/index.ts:533

class GOptional<T extends AnyType> extends Type<T, 'Optional'> {
  constructor(shape: T) {
    super()
    this.typeDef = shape.typeDef
    this.typeDef.isOptional = true
    this.typeDef.isRequired = false
  }

  list() {
    return new GList<this>(this)
  }

  default(value: InferRaw<T>) {
    this.typeDef.defaultValue = value
    return this
  }

  omitResolver () {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…