UNPKG

1.07 kBJavaScriptView Raw
1import _find from "lodash/fp/find";
2
3function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
5import microlearning from './microlearning';
6import learner from './learner';
7import externalConfig from './external';
8const engineConfigurations = {
9 microlearning,
10 learner,
11 external: externalConfig
12};
13export const getConfig = engine => {
14 const engineConfiguration = engineConfigurations[engine.ref];
15
16 if (!engineConfiguration) {
17 throw new Error(`Unknown engine ${engine.ref}`);
18 }
19
20 return _find({
21 version: engine.version
22 }, engineConfiguration.configurations) || engineConfiguration.defaultConfiguration;
23};
24export const getConfigForProgression = progression => {
25 return _extends(_extends({}, getConfig(progression.engine)), progression.engineOptions);
26};
27//# sourceMappingURL=index.js.map
\No newline at end of file