1.1.0 • Published 5 months ago

never-catch v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

never-catch

  • No boilerplate
  • Type support
  • Auto type infer
const divideTenBy = (a: number) => {
    if (a === 0) {
        return err('divide by zero');
    } else {
        return ok(10 / a);
    }
};

const result = divideTenBy(5);
if (result.ok) {
    console.log(result.value);// OK
} else {
    console.log(result.error);// Ok
    console.log(result.value);// TS2339: Property 'value' does not exist on type 'Err '.
}

Email: mnafisiasl@gmail.com

1.1.0

5 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago