0.1.7 • Published 10 days ago

sidekicker v0.1.7

Weekly downloads
2
License
MIT
Repository
-
Last release
10 days ago

sidekicker

Methods

tryCatch

A simple implementation of tryCatch, inspired in Java Exceptions+TryCatch.

const sum = tryCatch(
    (x: number) => {
        if (x === 1) throw new CustomError()
        if (x === 2) throw () => {
        };
        if (x === 3) throw "==>"
        return 1 + 1
    },
    // Will call this function if the throw==CustomError
    exception(CustomError, (e) => `THIS IS A ${e.name}`),
    // Will call this function if throw a function
    exception(Function, (e) => `THIS IS A __${e.constructor.name}__ ERROR`),
    // Will call this function if throw a string
    exception(String, (e) => `${e} string error`),
)
0.1.7

10 days ago

0.1.6

22 days ago

0.1.5

22 days ago

0.1.4

27 days ago

0.1.3

28 days ago

0.1.2

1 month ago

0.1.1

1 month ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago