🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

duel-names

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duel-names

Duel round names mixin for Duel tournaments

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 30 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts