Skip to content

Commit 4fe7ca6

Browse files
refactor(utils): remove redundant position getter
1 parent 5b71a6d commit 4fe7ca6

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

js/utils.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,13 @@ function requireFromString (src) {
3232
return m.exports;
3333
}
3434

35-
/**
36-
* Returns all discovered module positions.
37-
* @returns {Array<string>} Known module positions.
38-
*/
39-
function getAvailableModulePositions () {
40-
return modulePositions;
41-
}
42-
4335
/**
4436
* Checks whether the provided module position exists.
4537
* @param {string} position - Candidate module position.
4638
* @returns {boolean} True when the position is known.
4739
*/
4840
function moduleHasValidPosition (position) {
49-
if (getAvailableModulePositions().indexOf(position) === -1) return false;
50-
return true;
41+
return getModulePositions().includes(position);
5142
}
5243

5344
/**
@@ -314,4 +305,4 @@ function checkConfigFile (configObject) {
314305
}
315306
}
316307

317-
module.exports = { loadConfig, getModulePositions, moduleHasValidPosition, getAvailableModulePositions, checkConfigFile, ConfigError };
308+
module.exports = { loadConfig, getModulePositions, moduleHasValidPosition, checkConfigFile, ConfigError };

0 commit comments

Comments
 (0)