inhabit-module-base
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,3 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
var usedContent = []; | ||
/** | ||
@@ -49,3 +51,3 @@ * | ||
if (typeof this[deliveryMethod] !== 'function') { | ||
throw Error('No such fetchMethod: ' + deliveryMethod); | ||
throw Error('No such deliveryMethod: ' + deliveryMethod); | ||
} | ||
@@ -80,2 +82,18 @@ | ||
module.exports = InhabitModuleBase; | ||
/** | ||
* Resolve data | ||
* | ||
* @param data | ||
*/ | ||
InhabitModuleBase.prototype.resolve = function (data) { | ||
data.next = function () { | ||
for (var i = 0; i < data.length; i++) { | ||
if (usedContent.indexOf(data[i].id) === -1) { | ||
usedContent.push(data[i].id); | ||
return data[i]; | ||
} | ||
} | ||
}; | ||
this.deferred.resolve(data); | ||
}; |
{ | ||
"name": "inhabit-module-base", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A Base Module class for InHabit.", | ||
@@ -5,0 +5,0 @@ "main": "build/InhabitModuleBase.js", |
@@ -0,1 +1,5 @@ | ||
"use strict"; | ||
var usedContent = []; | ||
/** | ||
@@ -48,3 +52,3 @@ * | ||
if (typeof this[deliveryMethod] !== 'function') { | ||
throw Error('No such fetchMethod: ' + deliveryMethod); | ||
throw Error('No such deliveryMethod: ' + deliveryMethod); | ||
} | ||
@@ -79,2 +83,18 @@ | ||
module.exports = InhabitModuleBase; | ||
/** | ||
* Resolve data | ||
* | ||
* @param data | ||
*/ | ||
InhabitModuleBase.prototype.resolve = function (data) { | ||
data.next = function () { | ||
for (var i = 0; i < data.length; i++) { | ||
if (usedContent.indexOf(data[i].id) === -1) { | ||
usedContent.push(data[i].id); | ||
return data[i]; | ||
} | ||
} | ||
}; | ||
this.deferred.resolve(data); | ||
}; |
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
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
31131
198