HN user

stephen_hn

11 karma
Posts0
Comments5
View on HN
No posts found.

They've raised 450m according to this article. Their site mentions 250m raised in 2023. Even if your plan is growth or bust, how do you burn through 250m in two years without thinking 'Maybe we should plan to keep 50 or 100m for more than 2 years as an emergency fund'?

I'm just wondering if these guys have no financial literacy or just are really optimistic and want to burn through the cash to give them the best chance?

I kind of doubt of spending money at that rate does give them the best chance, but maybe they do.

Zod 4 1 year ago

I am not totally sure what your API's look like but if you know the API only has a certain type (or subset of types), you would only validate that type on the method. Don't use a single union for everything.

Here is some pseudocode.

Person = { name: string, height: number }

Animal = {name: string, capability: string}

A = { post: object, methodType: string, person: Person }

ModeratorA = { post: object, moderatorField1: string, moderatorField2: string, person: Person }

UnionA = A && ModeratorA (There's probably a better way of defining A and ModeratorA to share the shared fields)

B = { post: object, animal: Animal }

endpoint person parses UnionA

endpoint animal parses B

You don't put all of your types in one big Union.

Zod 4 1 year ago

I think you would use discrimated unions.

const MyResult = z.discriminatedUnion("status", [ z.object({ status: z.literal("success"), data: z.string() }), z.object({ status: z.literal("failed"), error: z.string() }), ]);

You can define passthrough behavior if there are a bunch of special attributes for a moderator but you don't want to list/check them all.

With different methods that have different schema- If they share part of the same schema with alterations, you can define an object for the shared part and create objects that contain the shared object schema with additional fields.

If you have a lot of different possibilities, it will be messy, but it sounds like it already is for you, so validators could still at least validate the messines.

Location: USA

Remote: Remote only

Willing to relocate: No

Technologies:

  Python

  C#/.NET

  Typescript, JavaScript, next.js, node.js, React

  AWS: Lambda, Glue, S3, DynamoDb, RDS, SQS, SNS, EventBridge,

  CDK, Cloudformation, Redshift

  CICD: Gitlab

  Data Pipelines: ETL, AWS Glue, spark, pandas

  ML pipeline experience
I am looking for an opportunity to build some solid cloud software. I can gather requirements and work cross functionally.

Résumé/CV: https://www.linkedin.com/in/slagree

Resume on request

Email: stephen.lagree@gmail.com