Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Message Parser Service

Simple TypeScript project for Message Parser.

Overview

  • Parses structured message input
  • Validates required segments and fields
  • Returns normalized JSON output
  • Includes unit tests with Vitest

Project Structure

src/
  parser/
  validators/
  types/
  errors/
tests/

Scripts

npm install
npm test
npm run typecheck

Input Format

  • Segments are separated by new lines
  • Segment fields are separated by |
  • Field components are separated by ^

Output

parseMessage(input: string): ParsedMessage

Example

Example input and output can be added here.

Notes

  • No database
  • Focused on parser logic and validation
  • Small, maintainable module layout

What I would do if I've more time

  1. Framework
  • I would setup a framework, maybe Express or Nest.js(mostly Express due to it's flexibility)
  • I would more structure the error handling to be fair with maybe something like Error categories or whatever make sense
  • I would implement some runtime validation tools like Zod to catch any type mismatch
  • Maybe also would like to cover logging, configuration to limit input size to guard the server and CI

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages