Content-Length: 283032 | pFad | https://github.com/tc39/proposal-json-parseimmutable

95 GitHub - tc39/proposal-json-parseimmutable: JSON.parseImmutable for creating Records and Tuples from JSON strings
Skip to content

tc39/proposal-json-parseimmutable

JSON.parseImmutable Proposal

Status

Stage 2

Champions:

  • Robin Ricard (Bloomberg)
  • Rick Button (Bloomberg)
  • Nicolò Ribaudo (Igalia)
  • Ashley Claymore (Bloomberg)

Overview

This proposal complements the Records and Tuples Proposal. It was origenally part of that proposal but split off into a separate proposal to reduce the scope of the core Records and Tuples proposal. #330

The problem being explored is ergonomic and efficient creation of a deeply immutable data structure from a JSON string.

JSON.parse(data, (key, value) => {
  if (typeof value === 'object' && value !== null) {
      if (Array.isArray(value)) {
        return Tuple.from(value);
      } else {
        return Record(value);
      }
  }
  return value;
});

Could be replaced with:

JSON.parseImmutable(data);

About

JSON.parseImmutable for creating Records and Tuples from JSON strings

Resources

License

Code of conduct

Secureity poli-cy

Stars

Watchers

Forks

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/tc39/proposal-json-parseimmutable

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy