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

baby-workers

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baby-workers - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

0

license.txt

@@ -0,0 +0,0 @@ The MIT License

2

package.json
{
"name": "baby-workers",
"version": "2.0.2",
"version": "2.0.3",
"description": "Execute and manage your code asynchronously with workers, like promise, execute each element of an array or a simple element in callback.",

@@ -5,0 +5,0 @@ "main": "workers.min.js",

@@ -257,5 +257,2 @@ var Workers = function()

if (_parent.stack.currentNode + 1 !== idNode && forceId === false) {
_engine.this.back(function() {
$execCallback('waiting');
}, false);
return $waitingNode(idNode, forceId);

@@ -268,15 +265,2 @@ }

if (_parent.limitExtra === false || parent === null || (parent.getLimit() > 0 && parent.getLimit() + _parent.limitWorkers <= parent.getTotalRunningWorkers() + _engine.this.getRunningWorkers())) {
// to opti
if (_engine.this.getRunningWorkers() === 0 && parent !== null && typeof(parent.back) === 'function') {
parent.back(function() {
$execCallback('waiting');
}, false);
} else {
_engine.this.back(function() {
$execCallback('waiting');
}, false);
}
//
return $waitingNode(idNode, forceId);

@@ -287,15 +271,2 @@ }

if (_parent.limitWorkers === 0 && parent !== null && parent.getLimit() > 0 && parent.getLimit() <= parent.getTotalRunningWorkers() + _engine.this.getRunningWorkers()) {
// to opti
if (_engine.this.getRunningWorkers() === 0 && parent !== null && typeof(parent.back) === 'function') {
parent.back(function() {
$execCallback('waiting');
}, false);
} else {
_engine.this.back(function() {
$execCallback('waiting');
}, false);
}
//
return $waitingNode(idNode, forceId);

@@ -305,5 +276,2 @@ }

if (_parent.stack.status === true && _parent.stack.isRunning !== $enum.STATUS.WAITING) {
_engine.this.back(function() {
$execCallback('waiting');
}, false);
return $waitingNode(idNode, forceId);

@@ -357,2 +325,4 @@ }

}
$execCallback('waiting');
});

@@ -359,0 +329,0 @@

@@ -1,1 +0,1 @@

var Workers=function(){var t=null,e={ROOT:"root",PARENT:"parent",NODE:"node"},n={CANCEL:"cancel",WAITING:"waiting",RUNNING:"running",FINISH:"finish"};Object.values="function"!=typeof Object.values?function(t){return Object.keys(t).map(function(e){return t[e]})}:Object.values;var r=function(i){this.flux={},this.create=function(t,n,i){return n="function"==typeof t?t:n,null===(t="function"==typeof t?null:t)||void 0===f.children[t]&&void 0===f.this[t]?(f.children[t]=new r(t),f.children[t].init(f.this,e.PARENT),f.children[t].setInfos(n),void 0!==(i="function"==typeof t?n:i)&&console.log("baby-worker : create function => data parameter is deprecated. It will be remove in v2.5.0"),!0===Array.isArray(i)?f.children[t].map(i):void 0!==i&&f.children[t].set(i),null!==t&&(f.this[t]=f.children[t]),f.children[t]):null},this.init=function(t,n,r){switch(f.id=r,f.type=n,f.parent=t,n){case e.ROOT:delete f.this.setInfos,delete f.this.set,delete f.this.map,delete f.this.timeout,delete f.this.interval,delete f.this.run,delete f.this.stack,delete f.this.push,delete f.this.cancel,delete f.this.node,delete f.this.pop,delete f.this.root,delete f.this.parent,delete f.this.back,delete f.this.getId,delete f.this.getNodeStatus;break;case e.PARENT:delete f.this.pop,delete f.this.root,delete f.this.getId,delete f.this.getNodeStatus;break;case e.NODE:delete f.this.setInfos,delete f.this.set,delete f.this.map,delete f.this.timeout,delete f.this.interval,delete f.this.run,delete f.this.stack,delete f.this.back,delete f.this.cancel,delete f.this.push,delete f.this.node}return delete f.this.init,f.this},this.setInfos=function(t){return h.callback=t,f.status=n.WAITING,delete f.this.setInfos,f.this},this.map=function(t){return!1===Array.isArray(t)?f.this.set(t):(h.data=t,f.this)},this.push=function(t){h.data.push(t);return f.type===e.PARENT&&f.status===n.FINISH&&f.this.next(),f.this},this.set=function(t){return h.data=[t],f.this},this.stack=function(){return h.stack.status=!0,f.this.next(),new Promise(function(t,e){f.this.then(t).catch(e)})},this.timeout=function(t){return console.log("baby-worker : timeout function is deprecated. It will be remove in v2.5.0"),f.this.delay(t)},this.delay=function(t){return t=null==t||"number"!=typeof t?1:t,setTimeout(f.this.run,t),new Promise(function(t,e){f.this.then(t).catch(e)})},this.interval=function(t){return t=null==t||"number"!=typeof t?1e3:t,f.this.addWorker(!0),h.isInterval=setInterval(function(){f.this.reply()},t),f.this.stop=function(){f.this.removeWorker(),clearInterval(h.isInterval)},new Promise(function(t,e){f.this.then(t).catch(e)})},this.run=function(){for(;f.this.next(););return f.this},this.reply=function(t){return void 0===t?(0===h.data.length&&h.data.push(void 0),h.data.map(function(t,e){f.this.exec(e,!0)}),f.this):f.this.exec(t,!0)},this.next=function(){return h.currentSeek+=1,null===f.this.exec(h.currentSeek,!1)?(h.currentSeek-=1,null):f.this},this.exec=function(t,n){if(n="boolean"!=typeof n||n,h.data.length<=t){if(0!==t)return null;h.data.push(void 0)}if(void 0===h.nodes[t]){var i=new r(f.name);i.init(f.this,e.NODE,t),h.nodes.push(i),h.workers+=1}return s(t,n),f.this};var s=function(t,e){if(f.status!==n.CANCEL){if(h.stack.currentNode+1!==t&&!1===e)return f.this.back(function(){c("waiting")},!1),u(t,e);var r=o();return h.limitWorkers>0&&h.limitWorkers<=h.runningWorkers&&(!1===h.limitExtra||null===r||r.getLimit()>0&&r.getLimit()+h.limitWorkers<=r.getTotalRunningWorkers()+f.this.getRunningWorkers())?(0===f.this.getRunningWorkers()&&null!==r&&"function"==typeof r.back?r.back(function(){c("waiting")},!1):f.this.back(function(){c("waiting")},!1),u(t,e)):0===h.limitWorkers&&null!==r&&r.getLimit()>0&&r.getLimit()<=r.getTotalRunningWorkers()+f.this.getRunningWorkers()?(0===f.this.getRunningWorkers()&&null!==r&&"function"==typeof r.back?r.back(function(){c("waiting")},!1):f.this.back(function(){c("waiting")},!1),u(t,e)):!0===h.stack.status&&h.stack.isRunning!==n.WAITING?(f.this.back(function(){c("waiting")},!1),u(t,e)):a(t,e)}},o=function(t){return void 0===t&&null!=f.parent?o(f.parent):void 0!==t&&0===t.getLimit()&&"function"==typeof t.root?o(t.root()):t},u=function(t,e){return h.waitingWorkers+=1,f.this.addWaitingWorker(),l("waiting",function(n){h.waitingWorkers-=1,f.this.removeWaitingWorker(),s(t,e)}),!1},a=function(t,e){!1===e&&(h.stack.currentNode+=1),h.runningWorkers+=1,h.stack.isRunning=n.RUNNING,h.nodes[t].addWorker(!0),h.nodes[t].complete(function(){h.runningWorkers-=1,!0===h.stack.status&&h.stack.currentNode<h.data.length?(h.stack.isRunning=n.WAITING,f.this.next()):0!==h.waitingWorkers?(h.stack.isRunning=n.WAITING,f.this.next()):null===h.isInterval&&(h.stack.isRunning=n.FINISH)});try{h.callback(h.nodes[t],h.data[t])}catch(e){h.nodes[t].error(e)}return!0};this.limit=function(t,e){return h.limitExtra="boolean"==typeof e&&e,h.limitWorkers=t<-1?-1:t,h.limitWorkers=!0===h.limitExtra&&-1===h.limitWorkers?0:h.limitWorkers,f.this},this.cancel=function(){return f.status===n.FINISH||f.status===n.CANCEL?null:(f.status=n.CANCEL,f.this)},this.error=function(t,e){return e="boolean"!=typeof e||e,f.error=null===f.error?t:f.error,null!==f.parent&&f.parent.error(f.error,!1),!0===e&&f.this.pop(),f.this},this.pop=function(){return f.nodeStatus!==n.RUNNING?null:f.this.removeWorker()},this.addWorker=function(t){return t="boolean"==typeof t&&t,f.status=n.RUNNING,!1===t?f.totalRunningWorkers+=1:f.nodeStatus=n.RUNNING,null!==f.parent&&f.parent.addWorker(!1),f.this},this.removeWorker=function(t){return void 0===t&&f.type===e.NODE?(f.nodeStatus=n.FINISH,t=f.id,null!==f.error?c("catch"):c("then"),c("complete")):(f.totalRunningWorkers-=1,void 0!==t&&c("back",t),0===f.totalRunningWorkers&&0!==f.totalWaitingWorkers&&(c("waiting"),f.status=n.WAITING),0===f.totalRunningWorkers&&0===f.totalWaitingWorkers&&(null!==f.error?c("catch"):c("then"),c("complete"),f.status=f.status===n.CANCEL?f.status:n.FINISH)),null!==f.parent&&f.parent.removeWorker(t),f.this},this.addWaitingWorker=function(){return f.totalWaitingWorkers+=1,null!==f.parent&&f.parent.addWaitingWorker(),f.this},this.removeWaitingWorker=function(){return f.totalWaitingWorkers-=1,null!==f.parent&&f.parent.removeWaitingWorker(),f.this},this.save=function(t,e){void 0===e&&(e=t,t=void 0);var n=function(t,r,i){if(0!==i.length)return t[r]=void 0===t[r]?{}:t[r],n(t[r],i.splice(0,1).shift(),i);t[r]=e};return n(f.this,"flux","string"!=typeof t?[]:t.split(".")),f.this},this._save=function(t,e){var n=f.parent;return null!==n&&n.save(t,e),f.this},this.get=function(t){var e=function(t,n,r){return 0===r.length?t[n]:(t[n]=void 0===t[n]?{}:t[n],e(t[n],r.splice(0,1).shift(),r))};return e(f.this,"flux","string"!=typeof t?[]:t.split("."))},this._get=function(t){var e=f.parent;return null===e?null:e.get(t)},this.root=function(){return f.parent},this.parent=function(n,r){return null==f.parent?null:(r=null==r?e.PARENT:r,f.parent.getName()!==n||r!==t&&f.parent.getType()!==r?void 0===f.parent.parent?null:f.parent.parent(n,r):f.parent)},this.parentNode=function(t){return f.this.parent(t,e.NODE)},this.node=function(t){return null==h.nodes[t]?null:h.nodes[t]},this.back=function(t,e){return l("back",t,e,function(t){return t}),f.this},this.complete=function(t,e){return f.status===n.FINISH&&(t(f.error),"boolean"!=typeof e||1==e)?f.this:(l("complete",t,e,function(){return f.error}),f.this)},this.then=function(t,e){return f.status===n.FINISH&&null===f.error&&(t(f.this.flux),"boolean"!=typeof e||1==e)?f.this:(l("then",t,e,function(){return f.this.flux}),f.this)},this.catch=function(t,e){return f.status===n.FINISH&&null!==f.error&&(t(f.error),"boolean"!=typeof e||1==e)?f.this:(l("catch",t,e,function(){return f.error}),f.this)};var l=function(t,e,n,r){return n="boolean"!=typeof n||n,r="function"==typeof r?r:null,f.callback.push({type:t,callback:e,removeAfterCall:n,param:r}),f.this},c=function(t,e){var n=f.callback;for(var r in f.callback=[],n)n[r].type===t?("boolean"==typeof n[r].removeAfterCall&&0==n[r].removeAfterCall&&f.callback.push(n[r]),n[r].callback("function"==typeof n[r].param?n[r].param(e):n[r].param)):f.callback.push(n[r])};this.getName=function(){return f.name},this.getType=function(){return f.type},this.getId=function(){return f.id},this.getError=function(){return f.error},this.getStatus=function(){return f.status},this.getNodeStatus=function(){return f.nodeStatus},this.getLimit=function(){return h.limitWorkers},this.getWorkers=function(){return h.workers},this.getWaitingWorkers=function(){return h.waitingWorkers},this.getRunningWorkers=function(){return h.runningWorkers},this.getTotalWorkers=function(){return h.nodes.length},this.getTotalWaitingWorkers=function(){return f.totalWaitingWorkers},this.getTotalRunningWorkers=function(){return f.totalRunningWorkers},this.getNodes=function(){return h.nodes};var h={limitWorkers:0,limitExtra:!1,wasRejected:!1,isInterval:null,nodes:[],workers:0,runningWorkers:0,waitingWorkers:0,data:[],callback:null,stack:{status:!1,currentNode:-1,isRunning:n.WAITING},currentSeek:-1},f={this:this,id:null,name:i,parent:null,status:t,nodeStatus:t,type:t,error:null,children:{},callback:[],totalRunningWorkers:0,totalWaitingWorkers:0}};return new r("root").init(null,e.ROOT)};try{module.exports=Workers}catch(t){}
var Workers=function(){var t=null,e={ROOT:"root",PARENT:"parent",NODE:"node"},n={CANCEL:"cancel",WAITING:"waiting",RUNNING:"running",FINISH:"finish"};Object.values="function"!=typeof Object.values?function(t){return Object.keys(t).map(function(e){return t[e]})}:Object.values;var r=function(i){this.flux={},this.create=function(t,n,i){return n="function"==typeof t?t:n,null===(t="function"==typeof t?null:t)||void 0===d.children[t]&&void 0===d.this[t]?(d.children[t]=new r(t),d.children[t].init(d.this,e.PARENT),d.children[t].setInfos(n),void 0!==(i="function"==typeof t?n:i)&&console.log("baby-worker : create function => data parameter is deprecated. It will be remove in v2.5.0"),!0===Array.isArray(i)?d.children[t].map(i):void 0!==i&&d.children[t].set(i),null!==t&&(d.this[t]=d.children[t]),d.children[t]):null},this.init=function(t,n,r){switch(d.id=r,d.type=n,d.parent=t,n){case e.ROOT:delete d.this.setInfos,delete d.this.set,delete d.this.map,delete d.this.timeout,delete d.this.interval,delete d.this.run,delete d.this.stack,delete d.this.push,delete d.this.cancel,delete d.this.node,delete d.this.pop,delete d.this.root,delete d.this.parent,delete d.this.back,delete d.this.getId,delete d.this.getNodeStatus;break;case e.PARENT:delete d.this.pop,delete d.this.root,delete d.this.getId,delete d.this.getNodeStatus;break;case e.NODE:delete d.this.setInfos,delete d.this.set,delete d.this.map,delete d.this.timeout,delete d.this.interval,delete d.this.run,delete d.this.stack,delete d.this.back,delete d.this.cancel,delete d.this.push,delete d.this.node}return delete d.this.init,d.this},this.setInfos=function(t){return h.callback=t,d.status=n.WAITING,delete d.this.setInfos,d.this},this.map=function(t){return!1===Array.isArray(t)?d.this.set(t):(h.data=t,d.this)},this.push=function(t){h.data.push(t);return d.type===e.PARENT&&d.status===n.FINISH&&d.this.next(),d.this},this.set=function(t){return h.data=[t],d.this},this.stack=function(){return h.stack.status=!0,d.this.next(),new Promise(function(t,e){d.this.then(t).catch(e)})},this.timeout=function(t){return console.log("baby-worker : timeout function is deprecated. It will be remove in v2.5.0"),d.this.delay(t)},this.delay=function(t){return t=null==t||"number"!=typeof t?1:t,setTimeout(d.this.run,t),new Promise(function(t,e){d.this.then(t).catch(e)})},this.interval=function(t){return t=null==t||"number"!=typeof t?1e3:t,d.this.addWorker(!0),h.isInterval=setInterval(function(){d.this.reply()},t),d.this.stop=function(){d.this.removeWorker(),clearInterval(h.isInterval)},new Promise(function(t,e){d.this.then(t).catch(e)})},this.run=function(){for(;d.this.next(););return d.this},this.reply=function(t){return void 0===t?(0===h.data.length&&h.data.push(void 0),h.data.map(function(t,e){d.this.exec(e,!0)}),d.this):d.this.exec(t,!0)},this.next=function(){return h.currentSeek+=1,null===d.this.exec(h.currentSeek,!1)?(h.currentSeek-=1,null):d.this},this.exec=function(t,n){if(n="boolean"!=typeof n||n,h.data.length<=t){if(0!==t)return null;h.data.push(void 0)}if(void 0===h.nodes[t]){var i=new r(d.name);i.init(d.this,e.NODE,t),h.nodes.push(i),h.workers+=1}return s(t,n),d.this};var s=function(t,e){if(d.status!==n.CANCEL){if(h.stack.currentNode+1!==t&&!1===e)return u(t,e);var r=o();return h.limitWorkers>0&&h.limitWorkers<=h.runningWorkers&&(!1===h.limitExtra||null===r||r.getLimit()>0&&r.getLimit()+h.limitWorkers<=r.getTotalRunningWorkers()+d.this.getRunningWorkers())?u(t,e):0===h.limitWorkers&&null!==r&&r.getLimit()>0&&r.getLimit()<=r.getTotalRunningWorkers()+d.this.getRunningWorkers()?u(t,e):!0===h.stack.status&&h.stack.isRunning!==n.WAITING?u(t,e):a(t,e)}},o=function(t){return void 0===t&&null!=d.parent?o(d.parent):void 0!==t&&0===t.getLimit()&&"function"==typeof t.root?o(t.root()):t},u=function(t,e){return h.waitingWorkers+=1,d.this.addWaitingWorker(),l("waiting",function(n){h.waitingWorkers-=1,d.this.removeWaitingWorker(),s(t,e)}),!1},a=function(t,e){!1===e&&(h.stack.currentNode+=1),h.runningWorkers+=1,h.stack.isRunning=n.RUNNING,h.nodes[t].addWorker(!0),h.nodes[t].complete(function(){h.runningWorkers-=1,!0===h.stack.status&&h.stack.currentNode<h.data.length?(h.stack.isRunning=n.WAITING,d.this.next()):0!==h.waitingWorkers?(h.stack.isRunning=n.WAITING,d.this.next()):null===h.isInterval&&(h.stack.isRunning=n.FINISH),c("waiting")});try{h.callback(h.nodes[t],h.data[t])}catch(e){h.nodes[t].error(e)}return!0};this.limit=function(t,e){return h.limitExtra="boolean"==typeof e&&e,h.limitWorkers=t<-1?-1:t,h.limitWorkers=!0===h.limitExtra&&-1===h.limitWorkers?0:h.limitWorkers,d.this},this.cancel=function(){return d.status===n.FINISH||d.status===n.CANCEL?null:(d.status=n.CANCEL,d.this)},this.error=function(t,e){return e="boolean"!=typeof e||e,d.error=null===d.error?t:d.error,null!==d.parent&&d.parent.error(d.error,!1),!0===e&&d.this.pop(),d.this},this.pop=function(){return d.nodeStatus!==n.RUNNING?null:d.this.removeWorker()},this.addWorker=function(t){return t="boolean"==typeof t&&t,d.status=n.RUNNING,!1===t?d.totalRunningWorkers+=1:d.nodeStatus=n.RUNNING,null!==d.parent&&d.parent.addWorker(!1),d.this},this.removeWorker=function(t){return void 0===t&&d.type===e.NODE?(d.nodeStatus=n.FINISH,t=d.id,null!==d.error?c("catch"):c("then"),c("complete")):(d.totalRunningWorkers-=1,void 0!==t&&c("back",t),0===d.totalRunningWorkers&&0!==d.totalWaitingWorkers&&(c("waiting"),d.status=n.WAITING),0===d.totalRunningWorkers&&0===d.totalWaitingWorkers&&(null!==d.error?c("catch"):c("then"),c("complete"),d.status=d.status===n.CANCEL?d.status:n.FINISH)),null!==d.parent&&d.parent.removeWorker(t),d.this},this.addWaitingWorker=function(){return d.totalWaitingWorkers+=1,null!==d.parent&&d.parent.addWaitingWorker(),d.this},this.removeWaitingWorker=function(){return d.totalWaitingWorkers-=1,null!==d.parent&&d.parent.removeWaitingWorker(),d.this},this.save=function(t,e){void 0===e&&(e=t,t=void 0);var n=function(t,r,i){if(0!==i.length)return t[r]=void 0===t[r]?{}:t[r],n(t[r],i.splice(0,1).shift(),i);t[r]=e};return n(d.this,"flux","string"!=typeof t?[]:t.split(".")),d.this},this._save=function(t,e){var n=d.parent;return null!==n&&n.save(t,e),d.this},this.get=function(t){var e=function(t,n,r){return 0===r.length?t[n]:(t[n]=void 0===t[n]?{}:t[n],e(t[n],r.splice(0,1).shift(),r))};return e(d.this,"flux","string"!=typeof t?[]:t.split("."))},this._get=function(t){var e=d.parent;return null===e?null:e.get(t)},this.root=function(){return d.parent},this.parent=function(n,r){return null==d.parent?null:(r=null==r?e.PARENT:r,d.parent.getName()!==n||r!==t&&d.parent.getType()!==r?void 0===d.parent.parent?null:d.parent.parent(n,r):d.parent)},this.parentNode=function(t){return d.this.parent(t,e.NODE)},this.node=function(t){return null==h.nodes[t]?null:h.nodes[t]},this.back=function(t,e){return l("back",t,e,function(t){return t}),d.this},this.complete=function(t,e){return d.status===n.FINISH&&(t(d.error),"boolean"!=typeof e||1==e)?d.this:(l("complete",t,e,function(){return d.error}),d.this)},this.then=function(t,e){return d.status===n.FINISH&&null===d.error&&(t(d.this.flux),"boolean"!=typeof e||1==e)?d.this:(l("then",t,e,function(){return d.this.flux}),d.this)},this.catch=function(t,e){return d.status===n.FINISH&&null!==d.error&&(t(d.error),"boolean"!=typeof e||1==e)?d.this:(l("catch",t,e,function(){return d.error}),d.this)};var l=function(t,e,n,r){return n="boolean"!=typeof n||n,r="function"==typeof r?r:null,d.callback.push({type:t,callback:e,removeAfterCall:n,param:r}),d.this},c=function(t,e){var n=d.callback;for(var r in d.callback=[],n)n[r].type===t?("boolean"==typeof n[r].removeAfterCall&&0==n[r].removeAfterCall&&d.callback.push(n[r]),n[r].callback("function"==typeof n[r].param?n[r].param(e):n[r].param)):d.callback.push(n[r])};this.getName=function(){return d.name},this.getType=function(){return d.type},this.getId=function(){return d.id},this.getError=function(){return d.error},this.getStatus=function(){return d.status},this.getNodeStatus=function(){return d.nodeStatus},this.getLimit=function(){return h.limitWorkers},this.getWorkers=function(){return h.workers},this.getWaitingWorkers=function(){return h.waitingWorkers},this.getRunningWorkers=function(){return h.runningWorkers},this.getTotalWorkers=function(){return h.nodes.length},this.getTotalWaitingWorkers=function(){return d.totalWaitingWorkers},this.getTotalRunningWorkers=function(){return d.totalRunningWorkers},this.getNodes=function(){return h.nodes};var h={limitWorkers:0,limitExtra:!1,wasRejected:!1,isInterval:null,nodes:[],workers:0,runningWorkers:0,waitingWorkers:0,data:[],callback:null,stack:{status:!1,currentNode:-1,isRunning:n.WAITING},currentSeek:-1},d={this:this,id:null,name:i,parent:null,status:t,nodeStatus:t,type:t,error:null,children:{},callback:[],totalRunningWorkers:0,totalWaitingWorkers:0}};return new r("root").init(null,e.ROOT)};try{module.exports=Workers}catch(t){}
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