inhabit-module-base
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -9,2 +9,4 @@ 'use strict'; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -35,3 +37,3 @@ | ||
this.deffered = this.$.Deffered(); | ||
this.deferred = this.$.Deffered(); | ||
this.content = []; | ||
@@ -50,3 +52,3 @@ } | ||
this.fetch(); | ||
return this.deffered.promise(); | ||
return this.deferred.promise(); | ||
} | ||
@@ -71,13 +73,38 @@ | ||
key: 'fetch', | ||
value: async function fetch() { | ||
var fetchMethod = this.configuration.deliveryMethod.name; | ||
var fetchParameters = this.configuration.deliveryMethod; | ||
value: function () { | ||
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { | ||
var fetchMethod, fetchParameters; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
fetchMethod = this.configuration.deliveryMethod.name; | ||
fetchParameters = this.configuration.deliveryMethod; | ||
if (typeof this[fetchMethod] !== 'function') { | ||
throw Error('No such fetchMethod: ' + fetchMethod); | ||
if (!(typeof this[fetchMethod] !== 'function')) { | ||
_context.next = 4; | ||
break; | ||
} | ||
throw Error('No such fetchMethod: ' + fetchMethod); | ||
case 4: | ||
// Execute a fetchMethod | ||
this[fetchMethod](fetchParameters); | ||
case 5: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, this); | ||
})); | ||
function fetch() { | ||
return _ref.apply(this, arguments); | ||
} | ||
// Execute a fetchMethod | ||
this[fetchMethod](fetchParameters); | ||
} | ||
return fetch; | ||
}() | ||
@@ -84,0 +111,0 @@ /** |
{ | ||
"name": "inhabit-module-base", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A Base Module class for InHabit.", | ||
@@ -28,4 +28,5 @@ "main": "build/InhabitModuleBase.js", | ||
"babel-plugin-syntax-async-functions": "^6.8.0", | ||
"babel-plugin-transform-async-to-generator": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0" | ||
} | ||
} |
@@ -18,5 +18,5 @@ /** | ||
console.log('Transforming file: ' + sourcepath); | ||
babel.transformFile(sourcepath, {}, function (err, result) { | ||
babel.transformFile(sourcepath, function (err, result) { | ||
if (err) { | ||
throw Error(err); | ||
throw err; | ||
} | ||
@@ -26,3 +26,3 @@ | ||
if (err) { | ||
throw Error(err); | ||
throw err; | ||
} | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148
32334
4
1