@jayesol/jayeson.lib.delivery 2.0.7-beta.0 → 2.0.8
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/CoreMessages.js +1 -248
- package/lib/DeliveryStack.js +1 -1212
- package/lib/Subscriber.js +1 -1083
- package/lib/index.js +1 -7
- package/lib/util.js +1 -64
- package/package.json +6 -4
package/lib/index.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
var 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);
|
|
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);
|
package/lib/util.js
CHANGED
|
@@ -1,64 +1 @@
|
|
|
1
|
-
var _
|
|
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
|
-
}
|
|
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&&null==arguments[r];r++);for(var i=r+1;i<arguments.length;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};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayesol/jayeson.lib.delivery",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Javascript implementation of Delivery",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "gulp test",
|
|
9
9
|
"build": "gulp compile",
|
|
10
|
-
"
|
|
10
|
+
"prepack": "npx gulp compile"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git"
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"gulp": "^4.0.2",
|
|
33
33
|
"gulp-install": "^1.1.0",
|
|
34
34
|
"gulp-jasmine": "^4.0.0",
|
|
35
|
+
"gulp-terser": "^2.1.0",
|
|
35
36
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
36
37
|
"gulp-uglify": "^3.0.2",
|
|
37
38
|
"jasmine": "^5.1.0",
|
|
38
|
-
"semver": "^7.5.4"
|
|
39
|
+
"semver": "^7.5.4",
|
|
40
|
+
"terser": "^5.44.1"
|
|
39
41
|
}
|
|
40
|
-
}
|
|
42
|
+
}
|