duel-names

1.2.0 • Public • Published

duel-names

npm status build status dependency status coverage status

A mixin module for Duel that puts roundName function on the Duel class prototype that outputs the normal english names for duel rounds. This is here, rather than inside the duel repository for easy internationalization.

Usage

Mixin with the Duel class:

var Duel = require('duel');
var duelNames = require('duel-names');
Duel.attachNames(duelNames(require('duel-names/english')));

var d = new Duel(4, { last: Duel.WB });
d.roundName(d.matches[3].id);
'Bronze Final';
d.roundName(d.matches[2].id);
'Grand Final'

You can pass in a full match id, or a partial Id. The id must minimally contain { s: bracket, r: round }.

Localizing

Add a language file, consider submitting it to this repo (but with tests please), or just maintain the language file yourself.

License

MIT-Licensed. See LICENSE file for details.

Readme

Keywords

none

Package Sidebar

Install

npm i duel-names

Weekly Downloads

2

Version

1.2.0

License

MIT

Last publish

Collaborators

  • clux