@suchipi/ts-json-utils
v1.0.0
Published
Utility types/functions to be used when working with JSON in TypeScript
Downloads
3
Maintainers
Readme
@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 andJSONValue
values)JSONArray
(type for array ofJSONValue
)JSONPrimitive
(type for all non-composite values which are valid in JSON)
Functions
parse
(re-export ofJSON.parse
, but typed as returningJSONValue
instead ofany
)stringify
(re-export ofJSON.stringify
, but typed as acceptingJSONValue
instead ofany
)
Installation
npm install --save-dev @suchipi/ts-json-utils
License
MIT