TypeScript

945 readers
1 users here now

founded 2 years ago
MODERATORS
1
 
 

I'd like to validate untrusted config JSON submitted to my application against a TypeScript interface. If it's bad, I'd like to serialize a TypeScript object with default values, and suggest it as a pattern.

Last time I looked, TypeScript didn't provide runtime access to types and interfaces, so I'm not clear if that's possible without build-time tomfoolery.

I'd prefer to avoid JSON schemas if I can, but I guess that's an option too.

Are there libraries or new-ish language features that I could use?

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
 

A trick that I'd like sharing :)

17
18
19
 
 

cross-posted from: https://programming.dev/post/18004176

I think object algebras have huge potential to improve the way complex software is written but I've never seen them used in practice. I think one reason why is that the research paper which introduced them is pretty hard to read. This post is my attempt to change that.

I've been working on this post off and on for like two years so I'm really excited to share it with people. It is very long. There's a lot of ground to cover.

20
 
 

The issue? I'm the idiot. Any suggestions for a guide to JS/TS for someone trying to learn about front-end development.

21
22
23
24
25
view more: next ›