INNER CODE UNIT · TypeScript

GRef

stepci/garph · src/index.ts:393

class GRef<T> extends Type<T, 'Ref'> {
  declare _inner: T extends RefType ? ReturnType<T> : T

  constructor(ref: T) {
    super()
    this.typeDef = {
      shape: ref,
      type: 'Ref'
    }
  }

  optional() {
    return new GOptional<this>(this)
  }

  required() {
    this.typeDef.isRequired = true
    return this

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…