4 ms·
JSON doesn’t really have data types beyond very simple ones
by SJC_Hacker 1y ago
JSON doesn’t really have data types beyond very simple ones
- motorest 1y ago> JSON doesn’t really have data types beyond very simple ones What do you think primitive types are supposed to be?
- Jenk 1y agoThe below type definition (TS) fits the ECMA schema for JSON: type JSON = string | number | boolean | null | JSON[] | {[name: string]: JSON}
- SJC_Hacker 1y agoI guess my point was something like an ISO 8601 date would be beyond the scope of a built in data type given JSONs philosophy of a minimal spec. It’s up to the end user to define types like that.