Skip to content

Instantly share code, notes, and snippets.

View emreuzelgok's full-sized avatar
🎯
Focusing

Emre Üzelgök emreuzelgok

🎯
Focusing
View GitHub Profile
@adamloving
adamloving / example.ts
Last active July 27, 2021 07:32
Isomorphic (shared) Typescript models for full stack Node Express React Postgres projects #NERP
import { array, object, number, string, date, InferType } from "yup";
import { Model } from "objection";
// Shared
// Shared API data schema (objects shared between client and server)
export const sharedSchema = object({
// none of these are required since not set until save (but they are also not nullable)
id: number()
.integer()
.notRequired(),