From af8d4e5f863401ecdbd4be2e485fdfae5ff47c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Tue, 27 Feb 2024 05:25:55 +0100 Subject: [PATCH] Cleanup --- src/tests.ts | 71 +++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 51 deletions(-) diff --git a/src/tests.ts b/src/tests.ts index bc2f258..2b5265a 100644 --- a/src/tests.ts +++ b/src/tests.ts @@ -40,58 +40,27 @@ const test = User.schema.extend({ User.schemaWithDefaultValues ) -const inst = User.create({ id: 1n, name: "" }) -const instEffect = User.createEffect({ id: 1n, name: "" }) +const inst = User.create({ id: 1n, name: "User" }) +// console.log(inst.name) +const instEffect = User.createEffect({ id: 1n, name: "User" }) -// console.log(inst) -const jsonifiedUser = await inst.jsonifyPromise() +// const jsonifiedUser = await inst.jsonifyPromise() -const AdminUserProto = User.extend() - .schema({ - schema: s => s.extend({ - name: z.literal("Admin"), - prout: z.string(), - }), - defaultValues: v => ({ ...v, name: "Admin" as const }), - }) - .jsonifiable({ - jsonifySchema: (s, json) => json.extend({ - prout: s.shape.prout - }) - }) +// const AdminUserProto = User.extend() +// .schema({ +// schema: s => s.extend({ +// name: z.literal("Admin"), +// prout: z.string(), +// }), +// defaultValues: v => ({ ...v, name: "Admin" as const }), +// }) +// .jsonifiable({ +// jsonifySchema: (s, json) => json.extend({ +// prout: s.shape.prout +// }) +// }) -class AdminUser extends AdminUserProto.toClass() {} -const subInst = await AdminUser.createPromise({ id: 2n, prout: "" }) -console.log(subInst) - - -// class Box { -// declare ["constructor"]: typeof Box -// constructor(public value: T) {} - -// otherMethod() { -// return "prout" as const -// } - -// newBox< -// C extends Class>, -// I extends Box, -// T, -// >( -// // this: Omit, "constructor"> & { ["constructor"]: Class } -// this: { ["constructor"]: C | Class> }, -// value: T, -// ) { -// // this.otherMethod() -// return new this.constructor(value) -// } -// } - -// class UnrelatedClass {} - -// class SuperBox extends Box { -// declare ["constructor"]: typeof SuperBox -// } - -// const value = new SuperBox(69).newBox(69) +// class AdminUser extends AdminUserProto.toClass() {} +// const subInst = await AdminUser.createPromise({ id: 2n, prout: "" }) +// console.log(subInst)