Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Migration to TypeScript #25

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

tedraykov
Copy link

Impact: minor
Type: refactor

Issue

The current API is using vanilla JavaScript which lacks type checking.

Solution

A migration to TypeScript will provide a better development experience.

Testing

  1. Run reaction API with the modified plugin

Co-authored-by: ts-migrate <>
Co-authored-by: ts-migrate <>

level = level.toUpperCase();
const outputModes = ["short", "long", "simple", "json", "bunyan"];
type OutputMode = "short" | "long" | "simple" | "json" | "bunyan";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing this because Bunyan type definitions do not export the Options interface and if the outputMode here does not match the string literal type defined in the BunyanFormat options, the compiler gives a type check error when instantiating the default stream on line 29.

@tedraykov
Copy link
Author

Using the new version of the Logger throws the following error:
TypeError: Logger.info is not a function
Have to investigate further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant