0.0.3 • Published 1 year ago

switch-stmt v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

switch-stmt

Overview

This package provides a simple way of writing switch statement logic with function chaining.

Installation

To install the package, use the following command in your project directory:

npm install switch-stmt

Usage

Importing

First, import the switchOn function from the package:

import { switchOn } from 'switch-stmt';

Basic Example

Here's a simple example of usage:

const result = switchOn(yourValue)
  .case('value1', () => 'Result for value1')
  .case('value2', 'Result for value2')
  .default(() => 'Default result')
  .eval();

License

This project is licensed under MIT.

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago