npm.io
1.0.0 • Published 3 years ago

@suchipi/ts-json-utils

Licence
MIT
Version
1.0.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
2

@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

Keywords