switch-stmt
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i switch-stmt

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

4.58 kB

Total Files

5

Last publish

Collaborators

  • jthure