Skip to content

Instantly share code, notes, and snippets.

@erikpukinskis
Last active September 1, 2025 18:27
Show Gist options
  • Save erikpukinskis/bd9c3aee59a1fad358bef35abf86896d to your computer and use it in GitHub Desktop.
Save erikpukinskis/bd9c3aee59a1fad358bef35abf86896d to your computer and use it in GitHub Desktop.
TypeScript type for arbitrary JSON values
/**
* TypeScript types for arbitrary JSON values
*/
type JsonPrimitive = string | number | boolean | null;
type JsonArray = JsonValue[];
type JsonObject = { [key: string]: JsonValue };
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment