Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inhabit-module-base

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inhabit-module-base - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

.idea/jsLibraryMappings.xml

63

build/InhabitModuleBase.js

@@ -7,2 +7,34 @@ "use strict";

/**
* setImmediate polyfill
*/
(function (global) {
if (!global.setImmediate) global.setImmediate = function () {
var head = {},
tail = head;
var ID = Math.random();
function onmessage(e) {
if (e.data != ID) return;
head = head.next;
var func = head.func;
delete head.func;
func();
}
if (global.addEventListener) {
// IE9+
global.addEventListener('message', onmessage);
} else {
// IE8
global.attachEvent('onmessage', onmessage);
}
return function (func) {
tail = tail.next = { func: func };
global.postMessage(ID, "*");
};
}();
})(global || window);
/**
*

@@ -30,33 +62,2 @@ * @param configuration

/**
* Get Content
* @returns {*}
*/
InhabitModuleBase.prototype.getContent = function () {
setTimeout(this.getDeliveryMethod(), 1);
return this.deferred.promise();
};
/**
*
* @returns {boolean}
*/
InhabitModuleBase.prototype.hasContent = function () {
return !!this.content.length;
};
/**
* Return a fetch method
*/
InhabitModuleBase.prototype.getDeliveryMethod = function () {
var deliveryMethod = this.configuration.deliveryMethod.name,
deliveryParameters = this.configuration.deliveryMethod;
if (typeof this[deliveryMethod] !== 'function') {
throw Error('No such deliveryMethod: ' + deliveryMethod);
}
return this[deliveryMethod].bind(this, deliveryParameters);
};
/**
* Store dependencies

@@ -63,0 +64,0 @@ * @param dependencies

@@ -9,5 +9,6 @@ /**

source: path.resolve('./src/'),
destination: path.resolve('./build/')
destination: path.resolve('./build/'),
tests: path.resolve('./tests')
};
module.exports = config;
{
"name": "inhabit-module-base",
"version": "1.1.4",
"version": "1.2.0",
"description": "A Base Module class for InHabit.",

@@ -29,4 +29,6 @@ "main": "build/InhabitModuleBase.js",

"babel-plugin-transform-async-to-generator": "^6.8.0",
"babel-preset-es2015": "^6.9.0"
"babel-preset-es2015": "^6.9.0",
"tap-spec": "^4.1.1",
"tape": "^4.6.0"
}
}

@@ -7,2 +7,31 @@ "use strict";

/**
* setImmediate polyfill
*/
(function (global) {
if (!global.setImmediate) global.setImmediate = (function() {
var head = { }, tail = head;
var ID = Math.random();
function onmessage(e) {
if(e.data != ID) return;
head = head.next;
var func = head.func;
delete head.func;
func();
}
if(global.addEventListener) { // IE9+
global.addEventListener('message', onmessage);
} else { // IE8
global.attachEvent('onmessage', onmessage );
}
return function(func) {
tail = tail.next = { func: func };
global.postMessage(ID, "*");
};
}());
})(global || window);
/**
*

@@ -31,33 +60,2 @@ * @param configuration

/**
* Get Content
* @returns {*}
*/
InhabitModuleBase.prototype.getContent = function () {
setTimeout(this.getDeliveryMethod(), 1);
return this.deferred.promise();
};
/**
*
* @returns {boolean}
*/
InhabitModuleBase.prototype.hasContent = function () {
return !!this.content.length;
};
/**
* Return a fetch method
*/
InhabitModuleBase.prototype.getDeliveryMethod = function () {
var deliveryMethod = this.configuration.deliveryMethod.name,
deliveryParameters = this.configuration.deliveryMethod;
if (typeof this[deliveryMethod] !== 'function') {
throw Error('No such deliveryMethod: ' + deliveryMethod);
}
return this[deliveryMethod].bind(this, deliveryParameters);
};
/**
* Store dependencies

@@ -64,0 +62,0 @@ * @param dependencies

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc