export function parse()

in packages/sdk/src/Schema.ts [118:139]


  export function parse(schema: FlagSchema): Schema {
    if (schema.boolSchema) {
      return Schema.BOOLEAN;
    }
    if (schema.doubleSchema) {
      return Schema.DOUBLE;
    }
    if (schema.intSchema) {
      return Schema.INTEGER;
    }
    if (schema.stringSchema) {
      return Schema.STRING;
    }
    if (schema.listSchema) {
      if (!schema.listSchema.elementSchema) throw new TypeError('ListSchema must specify an elementSchema');
      return list(parse(schema.listSchema.elementSchema));
    }
    if (schema.structSchema) {
      return struct(mapValues(schema.structSchema.schema, parse));
    }
    throw new TypeError(`Unknown schema type ${schema}`);
  }