/refactoring-simplifying-conditionals-js

Guide on how to simplify conditionals when working with existing code. These are some examples based on Fowler's book: Refactoring.

Primary LanguageTypeScriptMIT LicenseMIT

Refactoring Examples

This repository contains examples of various refactoring patterns. Each pattern is contained within its own directory and includes an initial.ts file with the existing code, a corresponding spec file for testing, and a solution.ts file that shows the code after applying the refactoring principle.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js
  • Yarn

Installation

  1. Clone the repo
git clone https://github.com/your_username_/refactoring-examples.git
  1. INstall NPM packages
yarn install

Usage

To run the tests for a specific refactoring pattern, navigate to its directory and run the following command:

yarn test

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details