Added numbers game.
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
const config = require('config');
|
||||
const style = require('./style');
|
||||
|
||||
function getLeaders(points, user, ping = true, limit = Infinity) {
|
||||
function getLeaders(points, user, { ping = true, limit = 20, skip = [] } = {}) {
|
||||
return Object.entries(points)
|
||||
.filter(([userKey]) => !skip.includes(userKey))
|
||||
.sort(([, scoreA], [, scoreB]) => scoreB - scoreA)
|
||||
.slice(0, limit)
|
||||
.map(([userKey, score], index) => {
|
||||
|
||||
1866
src/utils/numbers-solver.js
Normal file
1866
src/utils/numbers-solver.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@ function schatCode(text) {
|
||||
|
||||
function curate(fn) {
|
||||
return (text) => {
|
||||
if (text) {
|
||||
if (typeof text !== 'undefined' && text !== null) {
|
||||
return fn(text);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user