How to use the quicktype-core.matchType function in quicktype-core

To help you get started, we’ve selected a few quicktype-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github segmentio / typewriter / src / commands / gen-ios.ts View on Github external
protected memoryAttribute(t: Type, isNullable: boolean): MemoryAttribute {
    return matchType(
      t,
      anyType => super.memoryAttribute(t, isNullable),
      nullType => super.memoryAttribute(t, isNullable),
      boolType => super.memoryAttribute(t, isNullable),
      integerType => (isNullable ? 'strong' : 'copy'),
      doubleType => (isNullable ? 'strong' : 'copy'),
      stringType => super.memoryAttribute(t, isNullable),
      arrayType => super.memoryAttribute(t, isNullable),
      classType => super.memoryAttribute(t, isNullable),
      mapType => super.memoryAttribute(t, isNullable),
      enumType => super.memoryAttribute(t, isNullable),
      unionType => super.memoryAttribute(t, isNullable)
    )
  }
}