justinmchase / serializable

Serializable type definitions for TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serializable

Serializable type definitions for TypeScript and a helper function to convert anything into a safely serializable value.

Usage

import type { Serializable } from "https://deno.land/x/serializable/mod.ts";
import { toSerializable } from "https://deno.land/x/serializable/mod.ts";

export function send(message: unknown) {
  const serializable: Serializable = toSerializable(message);
  const data = JSON.stringify(message);
  // ...
}

About

Serializable type definitions for TypeScript

License:MIT License


Languages

Language:TypeScript 100.0%