@jayesol/jayeson.lib.delivery 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1 +1,7 @@
1
- var CoreMessages=require("./CoreMessages"),DeliveryStack=require("./DeliveryStack"),Subscriber=require("./Subscriber");function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}__export(CoreMessages),__export(DeliveryStack),__export(Subscriber);
1
+ var CoreMessages = require("./CoreMessages");
2
+ var DeliveryStack = require("./DeliveryStack");
3
+ var Subscriber = require("./Subscriber");
4
+
5
+ function __export(e) { for (var r in e) exports.hasOwnProperty(r) || (exports[r] = e[r]) }
6
+
7
+ __export(CoreMessages), __export(DeliveryStack), __export(Subscriber);
package/lib/util.js CHANGED
@@ -1 +1,64 @@
1
- var _=require("underscore");function _abstract(){throw"Abstract method is not yet implemented"}function _c(t,e){if(void 0===e)throw"Cannot initialize a class with undefined definition";if(void 0===t)throw"Cannot initialize class Undefined";var o,r,n={};for(r=2;r<arguments.length&&(void 0===arguments[r]||null===arguments[r]);r++);for(var i=r+1;i<arguments.length;i++)void 0!==arguments[i]&&null!==arguments[i]&&_.extend(n,arguments[i].prototype);r<arguments.length&&(o=arguments[r]),void 0!==o&&(t.prototype=Object.create(o.prototype)),_.extend(t.prototype,n),_.extend(t.prototype,e),t.prototype.constructor=t,null!=o&&(t.super=function(t){var e=Array.prototype.slice.call(arguments);e.shift(),o.apply(t,e)})}module.exports=exports={_abstract:_abstract,_c:_c};
1
+ var _ = require("underscore")
2
+
3
+ /************* UTILITY **********************************/
4
+
5
+ /**
6
+ * Represent an abstract method
7
+ */
8
+ function _abstract() { throw "Abstract method is not yet implemented" };
9
+
10
+ /**
11
+ * Define a class A with definition Def
12
+ * This method extend class A from a list of classes Bs (if Bs are defined)
13
+ *
14
+ * Example: _c(A, {}, B, C) will create a class A which extends B and C with B prioritized over C
15
+ * B will be the parent class of A, e.g. the super property of A will point to B
16
+ *
17
+ * Within A, we can call the constructor of the parent class with A.super(this). We can add in arguments if wanted
18
+ * e.g. A.super(this, a, b, c)
19
+ *
20
+ */
21
+ function _c(A, def) {
22
+
23
+ if (def === undefined) {
24
+ throw "Cannot initialize a class with undefined definition";
25
+ }
26
+
27
+ if (A === undefined) {
28
+ throw "Cannot initialize class Undefined";
29
+ }
30
+
31
+ // construct the prototype chain
32
+ var last;
33
+ var obj = {};
34
+ var firstIndex;
35
+ for (firstIndex = 2; firstIndex < arguments.length; firstIndex ++)
36
+ if (arguments[firstIndex] !== undefined && arguments[firstIndex] !== null)
37
+ break;
38
+
39
+ for (var i = firstIndex + 1; i < arguments.length; i++) {
40
+ if (arguments[i] !== undefined && arguments[i] !== null) { // mixin all prototypes into obj first
41
+ _.extend(obj, arguments[i].prototype);
42
+ }
43
+ }
44
+
45
+ if (firstIndex < arguments.length) last = arguments[firstIndex];
46
+
47
+ if (last !== undefined) A.prototype = Object.create(last.prototype); // put "last" into the A prototype chain
48
+
49
+ _.extend(A.prototype, obj); // mixin the combined mixins
50
+ _.extend(A.prototype, def); // mixin the definition
51
+
52
+ A.prototype.constructor = A;
53
+ if (last !== undefined && last !== null) A.super = function(self) {
54
+ var params = Array.prototype.slice.call(arguments);
55
+ params.shift();
56
+ last.apply(self, params); // call the parent constructor
57
+ };
58
+
59
+ }
60
+
61
+ module.exports = exports = {
62
+ _abstract : _abstract,
63
+ _c : _c
64
+ }
package/package.json CHANGED
@@ -1,41 +1,40 @@
1
- {
2
- "name": "@jayesol/jayeson.lib.delivery",
3
- "version": "2.0.6",
4
- "description": "Javascript implementation of Delivery",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "scripts": {
8
- "test": "gulp test",
9
- "prepare": "gulp compile",
10
- "prepublishOnly": "gulp prepublish"
11
- },
12
- "repository": {
13
- "type": "git"
14
- },
15
- "keywords": [
16
- "delivery"
17
- ],
18
- "author": "ryan",
19
- "license": "ISC",
20
- "dependencies": {
21
- "@jayesol/jayeson.lib.streamfinder": "2.0.0",
22
- "eventemitter3": "^2.0.3",
23
- "gulp-util": "^3.0.8",
24
- "jquery": "^1.7.2",
25
- "secure-random": "^1.1.1",
26
- "typescript": "^2.3.3",
27
- "underscore": "^1.8.3",
28
- "websocket": "^1.0.24"
29
- },
30
- "devDependencies": {
31
- "del": "^3.0.0",
32
- "glob": "^7.1.2",
33
- "gulp": "^3.9.1",
34
- "gulp-install": "^1.1.0",
35
- "gulp-jasmine": "^2.4.2",
36
- "gulp-typescript": "^3.1.6",
37
- "gulp-uglify": "^3.0.0",
38
- "jasmine": "^3.3.1",
39
- "semver": "^5.4.1"
40
- }
41
- }
1
+ {
2
+ "name": "@jayesol/jayeson.lib.delivery",
3
+ "version": "2.0.7",
4
+ "description": "Javascript implementation of Delivery",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "scripts": {
8
+ "test": "gulp test",
9
+ "build": "gulp compile",
10
+ "prepublishOnly": "gulp prepublish"
11
+ },
12
+ "repository": {
13
+ "type": "git"
14
+ },
15
+ "keywords": [
16
+ "delivery"
17
+ ],
18
+ "author": "ryan",
19
+ "license": "ISC",
20
+ "dependencies": {
21
+ "@jayesol/jayeson.lib.streamfinder": "2.0.0",
22
+ "eventemitter3": "^5.0.1",
23
+ "jquery": "^3.7.1",
24
+ "secure-random": "^1.1.2",
25
+ "typescript": "^5.3.3",
26
+ "underscore": "^1.13.6",
27
+ "websocket": "^1.0.34"
28
+ },
29
+ "devDependencies": {
30
+ "del": "^7.1.0",
31
+ "glob": "^10.3.10",
32
+ "gulp": "^4.0.2",
33
+ "gulp-install": "^1.1.0",
34
+ "gulp-jasmine": "^4.0.0",
35
+ "gulp-typescript": "^6.0.0-alpha.1",
36
+ "gulp-uglify": "^3.0.2",
37
+ "jasmine": "^5.1.0",
38
+ "semver": "^7.5.4"
39
+ }
40
+ }