1.0.0 • Published 10 months ago

@suchipi/ts-json-utils v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@suchipi/ts-json-utils

Utility types for describing JSON values in TypeScript

Exports

Types

  • JSONValue (type for any value which is valid in JSON)
  • JSONObject (type for object with string/number keys and JSONValue values)
  • JSONArray (type for array of JSONValue)
  • JSONPrimitive (type for all non-composite values which are valid in JSON)

Functions

  • parse (re-export of JSON.parse, but typed as returning JSONValue instead of any)
  • stringify (re-export of JSON.stringify, but typed as accepting JSONValue instead of any)

Installation

npm install --save-dev @suchipi/ts-json-utils

License

MIT