New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

horpyna

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

horpyna - npm Package Compare versions

Comparing version 0.3.8 to 0.3.10

69

dist/index.js

@@ -87,15 +87,15 @@ require("source-map-support").install();

var _channelManager = __webpack_require__(6);
var _channelManager = __webpack_require__(5);
var _channelManager2 = _interopRequireDefault(_channelManager);
var _parentChannelManager = __webpack_require__(8);
var _parentChannelManager = __webpack_require__(7);
var _parentChannelManager2 = _interopRequireDefault(_parentChannelManager);
var _response = __webpack_require__(9);
var _response = __webpack_require__(8);
var _response2 = _interopRequireDefault(_response);
var _errors = __webpack_require__(11);
var _errors = __webpack_require__(10);

@@ -108,3 +108,3 @@ var ERROR = _interopRequireWildcard(_errors);

var _channels = __webpack_require__(10);
var _channels = __webpack_require__(9);

@@ -144,8 +144,5 @@ var CHANNEL = _interopRequireWildcard(_channels);

key: "run",
value: function run(input) {
var _this = this;
return this.rootComponent.run(function () {
return _this._runProcess({ input: input });
});
value: function run(input, endCallback) {
this.rootComponent.run(endCallback);
this._runProcess({ input: input });
}

@@ -160,3 +157,3 @@

value: function _runProcess(request) {
var _this2 = this;
var _this = this;

@@ -166,3 +163,3 @@ if (typeof this.onProcess === "function") {

setTimeout(function () {
return _this2.onProcess(request, new _response2.default(_this2));
return _this.onProcess(request, new _response2.default(_this));
}, 0);

@@ -248,8 +245,2 @@ } else {

var _bluebird = __webpack_require__(5);
var _bluebird2 = _interopRequireDefault(_bluebird);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -276,3 +267,3 @@

* It need to have connection ready.
* @returns Promise promise is resolved when every component in tree is done.
* @returns none.
*/

@@ -282,11 +273,5 @@

key: "run",
value: function run(callback) {
var _this = this;
this.promise = new _bluebird2.default(function (resolve) {
_this.resolve = resolve;
_this.status = STATUS.PROCESS;
callback();
});
return this.promise;
value: function run(endCallback) {
this.endCallback = endCallback;
this.status = STATUS.PROCESS;
}

@@ -297,3 +282,5 @@ }, {

this.status = STATUS.DONE;
this.resolve(output);
if (this.endCallback) {
this.endCallback(output);
}
}

@@ -333,8 +320,2 @@

/* 5 */
/***/ function(module, exports) {
module.exports = require("bluebird");
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

@@ -350,3 +331,3 @@

var _channel = __webpack_require__(7);
var _channel = __webpack_require__(6);

@@ -387,3 +368,3 @@ var _channel2 = _interopRequireDefault(_channel);

/***/ },
/* 7 */
/* 6 */
/***/ function(module, exports, __webpack_require__) {

@@ -436,3 +417,3 @@

/***/ },
/* 8 */
/* 7 */
/***/ function(module, exports, __webpack_require__) {

@@ -448,3 +429,3 @@

var _channel = __webpack_require__(7);
var _channel = __webpack_require__(6);

@@ -506,3 +487,3 @@ var _channel2 = _interopRequireDefault(_channel);

/***/ },
/* 9 */
/* 8 */
/***/ function(module, exports, __webpack_require__) {

@@ -522,3 +503,3 @@

var _channels = __webpack_require__(10);
var _channels = __webpack_require__(9);

@@ -602,3 +583,3 @@ var CHANNEL = _interopRequireWildcard(_channels);

/***/ },
/* 10 */
/* 9 */
/***/ function(module, exports) {

@@ -614,3 +595,3 @@

/***/ },
/* 11 */
/* 10 */
/***/ function(module, exports) {

@@ -617,0 +598,0 @@

{
"name": "horpyna",
"version": "0.3.8",
"version": "0.3.10",
"description": "promised modules flow control core library",

@@ -20,3 +20,4 @@ "main": "index.js",

"modeling",
"conditional"
"conditional",
"organization"
],

@@ -38,3 +39,2 @@ "author": "Krzysztof Sztompka <sztompka.krzysztof@gmail.com>",

"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
"chai-things": "^0.2.0",

@@ -59,5 +59,3 @@ "del": "^2.2.0",

},
"dependencies": {
"bluebird": "^3.4.0"
}
"dependencies": {}
}

@@ -29,4 +29,5 @@ import Root from "./root";

*/
run(input) {
return this.rootComponent.run(() => this._runProcess({ input }));
run(input, endCallback) {
this.rootComponent.run(endCallback);
this._runProcess({ input });
}

@@ -33,0 +34,0 @@

import * as STATUS from "../constants/statuses";
import Promise from "bluebird";

@@ -17,11 +16,6 @@ class Root {

* It need to have connection ready.
* @returns Promise promise is resolved when every component in tree is done.
*/
run(callback) {
this.promise = new Promise((resolve) => {
this.resolve = resolve;
this.status = STATUS.PROCESS;
callback();
});
return this.promise;
run(endCallback) {
this.endCallback = endCallback;
this.status = STATUS.PROCESS;
}

@@ -31,3 +25,5 @@

this.status = STATUS.DONE;
this.resolve(output);
if(this.endCallback) {
this.endCallback(output);
}
}

@@ -34,0 +30,0 @@

import sinon from "sinon";
import chai from "chai";
import chaiThings from "chai-things";
import chaiAsPromised from "chai-as-promised";
import Promise from "bluebird";
import Horpyna from "../src/index";
chai.use(chaiThings);
chai.use(chaiAsPromised);
const expect = chai.expect;

@@ -19,3 +16,3 @@

it("should resolve promise when function logic is in constructor", done => {
it("should finish chain when process function is constructor argument", done => {
let spyComponent = sinon.spy();

@@ -28,4 +25,3 @@ let spyCustomFunc = sinon.spy();

component.final();
let promise = component.run();
promise.then(output => {
component.run(null, output => {
spyComponent();

@@ -50,4 +46,3 @@ expect(spyComponent.calledOnce).to.be.true;

component.final();
let promise = component.run();
promise.then(output => {
component.run(null, output => {
spyComponent();

@@ -76,4 +71,3 @@ expect(spyComponent.calledOnce).to.be.true;

let component = new ExtendComponent();
let promise = component.run();
promise.then(output => {
let promise = component.run(null, output => {
spyComponent();

@@ -90,7 +84,8 @@ expect(spyComponent.calledOnce).to.be.true;

let component = new Horpyna.Component();
let promise = component.run();
promise.catch(e => {
try {
component.run();
} catch(e) {
expect(e).to.be.deep.equal(new Error());
done();
});
}
});

@@ -141,4 +136,3 @@

componentC.bind(componentB);
let promise = componentA.run();
promise.then((response) => {
componentA.run(null, output => {
spyComponent();

@@ -153,3 +147,2 @@ expect(spyA.calledOnce).to.be.true;

});
});

@@ -196,4 +189,3 @@

componentD.bind(componentC);
let promise = componentA.run();
promise.then((response) => {
componentA.run(null, output => {
spyComponent();

@@ -211,3 +203,2 @@ expect(spyA.calledOnce).to.be.true;

});
});

@@ -237,4 +228,3 @@

let promise = componentA.run();
promise.then((response) => {
componentA.run(null, otput => {
expect(spyA.calledOnce).to.be.true;

@@ -281,4 +271,3 @@ expect(spyB.calledOnce).to.be.true;

componentC.final();
let promise = componentA.run();
promise.then((response) => {
componentA.run(null, output => {
expect(spyAA.calledOnce).to.be.true;

@@ -285,0 +274,0 @@ expect(spyAB.calledOnce).to.be.true;

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