Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

Text · 12 lines · 409 B · at eb4a6ea

// Ordinary .tsus code: no casts, just a typed Result from the boundary.import { loadConfig } from "./config.boundary.tsus";const show = (raw: string): string =>  match (loadConfig(raw)) {    Ok(config) => `${config.host}:${config.port}`,    Err(e) => `config error: ${e}`,  };console.log(show('{"port":8080,"host":"localhost"}'));console.log(show('{"port":"eighty"}'));console.log(show("{oops"));