Use 'Object.values' and 'Object.keys' instead of '_.each(object)'

This commit is contained in:
Hongarc 2018-12-01 12:33:23 +07:00
parent bd8009386d
commit 96ddb5041a
9 changed files with 52 additions and 33 deletions

View file

@ -52,7 +52,8 @@ var validateLevel = function(level) {
/**
* Unpack the level sequences.
*/
_.each(levelSequences, function(levels, levelSequenceName) {
Object.keys(levelSequences).forEach(function(levelSequenceName) {
var levels = levelSequences[levelSequenceName];
_sequences.push(levelSequenceName);
if (!levels || !levels.length) {
throw new Error('no empty sequences allowed');