Skip to content

Commit

Permalink
Export all helpers in public API (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 authored Oct 31, 2022
1 parent fb0c0a6 commit fc19bff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 56 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ As you can see, the [manager](https://drarig29.github.io/brackets-docs/reference

You can navigate the API documentation here: [`BracketsManager` class documentation](https://drarig29.github.io/brackets-docs/reference/manager/classes/BracketsManager.html)

You also have access to all of the helpers defined by the library (see [list of helpers here](https://drarig29.github.io/brackets-docs/reference/manager/modules/helpers.html)):

```js
const { helpers } = require('brackets-manager');
```

# Credits

This library has been created to be used by the [Nantarena](https://nantarena.net/).
Expand Down
58 changes: 2 additions & 56 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BracketsManager } from './manager';
import * as helpers from './helpers';

import {
CrudInterface,
Expand All @@ -14,34 +15,6 @@ import {
Table,
} from './types';

import {
getWinner,
getLoser,
getMatchResult,
isMatchStarted,
isMatchCompleted,
isMatchForfeitCompleted,
isMatchResultCompleted,
isMatchDrawCompleted,
isMatchWinCompleted,
isMatchByeCompleted,
isMatchUpdateLocked,
isMatchParticipantLocked,
hasBye,
getUpperBracketRoundCount,
getRoundPairCount,
getLoserRoundMatchCount,
getLoserRoundLoserCount,
getLowerBracketRoundCount,
getNearestPowerOfTwo,
minScoreToWinBestOfX,
isRoundRobin,
isWinnerBracket,
isLoserBracket,
isFinalGroup,
getMatchLocation,
} from './helpers';

export {
BracketsManager,
CrudInterface,
Expand All @@ -55,32 +28,5 @@ export {
StandardBracketResults,
Storage,
Table,
};

export const helpers = {
getWinner,
getLoser,
getMatchResult,
isMatchStarted,
isMatchCompleted,
isMatchForfeitCompleted,
isMatchResultCompleted,
isMatchDrawCompleted,
isMatchWinCompleted,
isMatchByeCompleted,
isMatchUpdateLocked,
isMatchParticipantLocked,
hasBye,
getUpperBracketRoundCount,
getRoundPairCount,
getLoserRoundMatchCount,
getLoserRoundLoserCount,
getLowerBracketRoundCount,
getNearestPowerOfTwo,
minScoreToWinBestOfX,
isRoundRobin,
isWinnerBracket,
isLoserBracket,
isFinalGroup,
getMatchLocation,
helpers,
};

0 comments on commit fc19bff

Please sign in to comment.