Skip to content

Commit

Permalink
add mollitia icon, add eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cadgerfeast committed Mar 12, 2021
1 parent c994cf8 commit e6fca45
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"max-len": [2, { "code": 160 }],
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }],
"no-return-await": [2],
"consistent-return": [2],
"semi": [2, "always"],
"@typescript-eslint/await-thenable": [2],
"@typescript-eslint/no-unused-vars": [2]
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[![Downloads](https://img.shields.io/npm/dt/mollitia)](https://www.npmjs.com/package/mollitia)
[![License](https://img.shields.io/npm/l/mollitia)](https://github.com/cadgerfeast/mollitia/blob/master/LICENSE)

<p align="center"><br/><img width="200" src="https://genesys.github.io/mollitia/icon.svg" alt="Mollitia Icon"/><br/><br/></p>

`Mollitia` is a **JavaScript Resilience** library that works on Node and on browsers.
The purpose of such kind of tool is to help organize **asynchronous operations** under a highly customizable circuit that helps managing error use cases.
When everything is falling apart, it stops the classic flow and uses modules to manage failures.
Expand Down
2 changes: 2 additions & 0 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ description: JavaScript Resilience Library
[![Downloads](https://img.shields.io/npm/dt/mollitia)](https://www.npmjs.com/package/mollitia)
[![License](https://img.shields.io/npm/l/mollitia)](https://github.com/cadgerfeast/mollitia/blob/master/LICENSE)

<p align="center"><br/><img width="200" src="./docs/static/icon.svg" alt="Mollitia Icon"/><br/><br/></p>

`Mollitia` is a **JavaScript Resilience** library that works on Node and on browsers.
The purpose of such kind of tool is to help organize **asynchronous operations** under a highly customizable circuit that helps managing error use cases.
When everything is falling apart, it stops the classic flow and uses modules to manage failures.
Expand Down
Binary file modified docs/static/favicon.ico
Binary file not shown.
Binary file removed docs/static/icon.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/static/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/module/breaker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export abstract class SlidingWindowBreaker<T> extends Module {
return Promise.reject(new BreakerError());
case BreakerState.HALF_OPENED:
return this.executeInHalfOpened(promise, ...params);
default:
case BreakerState.CLOSED:
return this.executeInClosed(promise, ...params);
}
Expand Down
2 changes: 1 addition & 1 deletion src/module/bulkhead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class Bulkhead extends Module {
this.queueBuffer.splice(this.queueBuffer.indexOf(ref), 1);
resolveDisposable.dispose();
rejectDisposable.dispose();
reject(new BulkheadQueueWaitError())
reject(new BulkheadQueueWaitError());
}, this.maxQueueWait);
const executeDisposable = ref.on('execute', () => {
executeDisposable.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/module/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Timeout extends Module {
.catch((result) => {
clearTimeout(timeout);
return Promise.reject(result);
})
});
} else {
return promise(...params);
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/module/breaker/sliding-count-breaker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Sliding Count Breaker', () => {
expect(circuit.fn(failureAsync).execute('dummy', 50)).rejects.toEqual('dummy');
expect(slidingCountBreaker.state).toEqual(Mollitia.BreakerState.HALF_OPENED);
await expect(circuit.fn(successAsync).execute('dummy')).rejects.toThrow('Max allowed requests reached');
})
});
it('Slow Requests', async () => {
const slidingCountBreaker = new Mollitia.SlidingCountBreaker({
failureRateThreshold: 50,
Expand Down

0 comments on commit e6fca45

Please sign in to comment.