This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ChildAndParent<TParent, TChild> = TParent extends string | |
? `${TParent}.${TChild extends string ? TChild : never}` | |
: TChild; | |
type DotNotation<T, TParent = false> = T extends object | |
? { [K in keyof T]: TParent | DotNotation<T[K], ChildAndParent<TParent, K>> }[keyof T] | |
: TParent | |
type Foo = DotNotation<{ | |
a: "hello" | |
b: "darkness" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* node UPNP port forwarding PoC | |
This is a simple way to forward ports on NAT routers with UPNP. | |
This is a not-for-production hack that I found useful when testing apps | |
on my home network behind ny NAT router. | |
-satori | |
usage: |