Skip to content

Latest commit

 

History

History

2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Challenge 2 - Write your own JSON parser

This challenge corresponds to the second part of the Coding Challenges series by John Crickett https://codingchallenges.fyi/challenges/challenge-json-parser.

Description

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.

Usage

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();

Run tests

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).