Post
Cynthia 🐈
cynthia.dev
did:plc:agdt777o3eknfm25dcvpueu5
Isn't that feasible using discriminated unions in TypeScript? Or for more complex cases type guards? 🤔
I feel like the downside is that it doesn't let you unwrap the value but I feel that's about it..? Or am I missing something obvious 🤔
www.typescriptlang.org/play/#code/K...
https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAbwL4FgBQ6YE8zDgJWAGcBXAGxgB4AVAGjgFEA+OAXnQEgAfROUgY37EiALjgwoJYAG44UYuRhjqcVGm68BQoqLgAzAIZkiMuMChRoYhqvToAJsH5kD8-SQB2-GAEsIHuAALIxgACgBKMQ9gADdzOzRHZ1c8fn8ieHlSCjFCbKo8yA8TegYLaCYEnz04UKzFADotYXDETnqKTgB6LrgAPQB+BI4euABVLwgAWyngD3gYCDgIACMTKDi4AAMOmC24FadpvBhAvHNLKDh+AxM+XH5qnxuyMiwD4DIIAHdu3uCKBF0Gp0Lt0KNBuggA
2024-06-25T16:08:14.483Z