Skip to content

Instantly share code, notes, and snippets.

@inaz2
Last active March 15, 2023 04:17
Show Gist options
  • Save inaz2/b047b5180ab48de0c80247edf0e63829 to your computer and use it in GitHub Desktop.
Save inaz2/b047b5180ab48de0c80247edf0e63829 to your computer and use it in GitHub Desktop.
interface T<V> { valueOf(): V }
type HECK<V> = V extends T<infer R> ? T<R> : never
type P = string | number | boolean | null | undefined
type FXCK = { [k: string]: U }
type SXIT = (...args: U[]) => U | void
type U = U[] | FXCK | SXIT | P | HECK<any>
let fxck: U
fxck = {}; console.log(fxck) // FXCK | T<unknown>
fxck = []; console.log(fxck) // U[] | T<unknown>
fxck = ""; console.log(fxck) // string | T<unknown>
fxck = 0; console.log(fxck) // number | T<unknown>
fxck = true; console.log(fxck) // true | T<unknown>
fxck = false; console.log(fxck) // false | T<unknown>
fxck = null; console.log(fxck) // null
fxck = undefined; console.log(fxck) // undefined
fxck = (a,b) => a+b; console.log(fxck) // SXIT | T<unknown>
fxck = /./; console.log(fxck) // T<unknown>
fxck = new Date(); console.log(fxck) // T<unknown>
fxck = { the: fxck };
const what = { the: fxck }; console.log(what) // { the: FXCK; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment