diff --git a/CHANGELOG.md b/CHANGELOG.md index d09c221..868ad3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,48 +1,46 @@ # [2.0.0](https://github.com/rogwilco/Try/compare/v1.0.0...v2.0.0) (2020-09-01) - ### Breaking -* Renamed Throwable to ThrowableType to better reflect its purpose. ([3389b54](https://github.com/rogwilco/Try/commit/3389b549519c67680221e1c44aeaa64e1d70ba3e)) +- Renamed Throwable to ThrowableType to better reflect its purpose. ([3389b54](https://github.com/rogwilco/Try/commit/3389b549519c67680221e1c44aeaa64e1d70ba3e)) ### Build -* Ensured TypeScript is actually transpiled during the publish job. ([6e8ccbb](https://github.com/rogwilco/Try/commit/6e8ccbb90be577b8459f87dd2c608dc67cfe097a)) +- Ensured TypeScript is actually transpiled during the publish job. ([6e8ccbb](https://github.com/rogwilco/Try/commit/6e8ccbb90be577b8459f87dd2c608dc67cfe097a)) ### Docs -* Fixed NPM badge in README. ([e3bfa1d](https://github.com/rogwilco/Try/commit/e3bfa1d86777268b0c3f0ebe8f24fadcaccdd842)) +- Fixed NPM badge in README. ([e3bfa1d](https://github.com/rogwilco/Try/commit/e3bfa1d86777268b0c3f0ebe8f24fadcaccdd842)) # 1.0.0 (2020-09-01) - ### Build -* Added semantic-relase config and plugins. ([a0f89c7](https://github.com/rogwilco/Try/commit/a0f89c7885455a8e546a2e7657710b4a4e612e74)) -* Initial setup for GitHub actions, created CI workflow. ([86a495f](https://github.com/rogwilco/Try/commit/86a495f4eff26dff35c2ff276944570188c5bbaf)) +- Added semantic-relase config and plugins. ([a0f89c7](https://github.com/rogwilco/Try/commit/a0f89c7885455a8e546a2e7657710b4a4e612e74)) +- Initial setup for GitHub actions, created CI workflow. ([86a495f](https://github.com/rogwilco/Try/commit/86a495f4eff26dff35c2ff276944570188c5bbaf)) ### Chore -* Added project configuration files. ([0594bc7](https://github.com/rogwilco/Try/commit/0594bc73db19a6672747f9900e0178829a92ec9f)) -* Added tests. ([e426728](https://github.com/rogwilco/Try/commit/e42672807a51d928bc9ddc8732d5621c442879d0)) -* Added TypeDoc support. ([c4e4905](https://github.com/rogwilco/Try/commit/c4e49053faeed98473dd1f2ce7a2031259014fbf)) -* Setting up project. ([88ca902](https://github.com/rogwilco/Try/commit/88ca9028a97f578445d891f3d9fbae5ada133d89)) +- Added project configuration files. ([0594bc7](https://github.com/rogwilco/Try/commit/0594bc73db19a6672747f9900e0178829a92ec9f)) +- Added tests. ([e426728](https://github.com/rogwilco/Try/commit/e42672807a51d928bc9ddc8732d5621c442879d0)) +- Added TypeDoc support. ([c4e4905](https://github.com/rogwilco/Try/commit/c4e49053faeed98473dd1f2ce7a2031259014fbf)) +- Setting up project. ([88ca902](https://github.com/rogwilco/Try/commit/88ca9028a97f578445d891f3d9fbae5ada133d89)) ### Docs -* Added empty README. ([7d74b9d](https://github.com/rogwilco/Try/commit/7d74b9d3a7291d579b49a6c440b9911afac2f8a7)) -* Added LICENSE with BSD-3-Clause license. ([7b5f51c](https://github.com/rogwilco/Try/commit/7b5f51c8a8a7dc645f5ce5f2a5b64b3508856a12)) -* Updated README with requirements and install/usage instructions. ([a7b8ca2](https://github.com/rogwilco/Try/commit/a7b8ca2865b9364e98417ed37456adc95e1d30c3)) +- Added empty README. ([7d74b9d](https://github.com/rogwilco/Try/commit/7d74b9d3a7291d579b49a6c440b9911afac2f8a7)) +- Added LICENSE with BSD-3-Clause license. ([7b5f51c](https://github.com/rogwilco/Try/commit/7b5f51c8a8a7dc645f5ce5f2a5b64b3508856a12)) +- Updated README with requirements and install/usage instructions. ([a7b8ca2](https://github.com/rogwilco/Try/commit/a7b8ca2865b9364e98417ed37456adc95e1d30c3)) ### New -* Added Handle() function for use with native try/catch/finally blocks. ([da42211](https://github.com/rogwilco/Try/commit/da422113f22e7bce483642fcd37c67fe691f520e)) -* Initial implementation. ([fd8ccd0](https://github.com/rogwilco/Try/commit/fd8ccd072251bc58437f0fb824c00fc5fd91e8ba)) +- Added Handle() function for use with native try/catch/finally blocks. ([da42211](https://github.com/rogwilco/Try/commit/da422113f22e7bce483642fcd37c67fe691f520e)) +- Initial implementation. ([fd8ccd0](https://github.com/rogwilco/Try/commit/fd8ccd072251bc58437f0fb824c00fc5fd91e8ba)) ### Update -* Improved catch block matching to include parent classes. ([3713643](https://github.com/rogwilco/Try/commit/371364300fad6e77ce949b80c5cefcb7b32c4b50)) +- Improved catch block matching to include parent classes. ([3713643](https://github.com/rogwilco/Try/commit/371364300fad6e77ce949b80c5cefcb7b32c4b50)) ### Upgrade -* Upgraded dev dependencies. ([8379d99](https://github.com/rogwilco/Try/commit/8379d999daf81aa04f0d298a53fbb8f689409714)) +- Upgraded dev dependencies. ([8379d99](https://github.com/rogwilco/Try/commit/8379d999daf81aa04f0d298a53fbb8f689409714)) diff --git a/README.md b/README.md index 0aea9e0..bb71db5 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ try { // This block is only invoked if a TypeError is thrown. TypeError: e => { console.error(`Type Error: ${e.message}`) - } + }, }) } finally { // This block is executed regardless of wheter any errors were caught. diff --git a/jest.config.js b/jest.config.js index 77bed3e..f8049fe 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,11 +5,11 @@ module.exports = { coverageDirectory: 'out/coverage', globals: { 'ts-jest': { - tsConfig: 'tsconfig.json' - } + tsConfig: 'tsconfig.json', + }, }, moduleDirectories: ['node_modules', 'src'], preset: 'ts-jest', testEnvironment: 'node', - testMatch: ['**/*.test.ts'] + testMatch: ['**/*.test.ts'], } diff --git a/src/index.test.ts b/src/index.test.ts index 29f0c84..e9dead6 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -413,7 +413,7 @@ describe('Handle()', () => { throw new ExceptionTwo('Waat?') } catch (e) { Handle(e, { - ExceptionOne: catchBlockOne + ExceptionOne: catchBlockOne, }) } }).toThrow(ExceptionTwo) @@ -430,7 +430,7 @@ describe('Handle()', () => { } catch (e) { Handle(e, { ExceptionOne: catchBlockOne, - ExceptionTwo: catchBlockTwo + ExceptionTwo: catchBlockTwo, }) } @@ -447,7 +447,7 @@ describe('Handle()', () => { throw new AnotherError('Say whaaaaat?') } catch (e) { Handle(e, { - Error: catchBlock + Error: catchBlock, }) }