This challenge corresponds to the second part of the Coding Challenges series by John Crickett https://codingchallenges.fyi/challenges/challenge-json-parser.
The JSON parser is written in json-parser.ts
. The tool is used to parse a given string and returns the equivalent object representation of the string in TypeScript.
Check out this Notion page to understand how I approached this challenge.
You can directly import the tool into any TypeScript file as follows:
import { JsonParser } from 'path/to/json-parser.ts';
const output = new JsonParser(input).parse();
To run the tests for the JSON parser tool, go to the root directory of this repository and run the following command:
npm test src/2/
All the tests are made for LINUX environment only. If you want to run the tests in Windows environment, you can use the Git Bash terminal or Windows Subsystem for Linux (WSL).