Type alias ForeignKeyToValue<T>

ForeignKeyToValue<T>: {
    [K in keyof T]: T[K] extends NullableForeignKey
        ? Optional<string>
        : T[K] extends ForeignKey
            ? string
            : T[K]
}

Allow ForeignKey attributes to be passes to the create method by using their inferred primitive type Ex: If ModelA has: attr1: ForeignKey This allows" ModelA.create({ attr1: "someVal" }) Instead of: ModelA.create({ attr1: "someVal" as ForeignKey })

Type Parameters

  • T

Generated using TypeDoc