@alterior/common 3.0.0-rc.5 → 3.0.0-rc.6
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/dist/base64.js +11 -14
- package/dist/base64.js.map +1 -1
- package/dist/cache.js +76 -105
- package/dist/cache.js.map +1 -1
- package/dist/cache.test.js.map +1 -1
- package/dist/clone.d.ts.map +1 -1
- package/dist/clone.js +10 -4
- package/dist/clone.js.map +1 -1
- package/dist/clone.test.js.map +1 -1
- package/dist/coalesce.js +5 -21
- package/dist/coalesce.js.map +1 -1
- package/dist/coalesce.test.js.map +1 -1
- package/dist/colors.js +5 -5
- package/dist/colors.js.map +1 -1
- package/dist/console.js +17 -43
- package/dist/console.js.map +1 -1
- package/dist/decorators.js +1 -1
- package/dist/decorators.js.map +1 -1
- package/dist/environment.js +16 -21
- package/dist/environment.js.map +1 -1
- package/dist/errors.js +89 -143
- package/dist/errors.js.map +1 -1
- package/dist/errors.test.js.map +1 -1
- package/dist/get-param-names.js +7 -7
- package/dist/index.js +1 -1
- package/dist/lazy-promise.js +18 -23
- package/dist/lazy-promise.js.map +1 -1
- package/dist/lazy-subject.js +6 -6
- package/dist/lazy-subject.js.map +1 -1
- package/dist/locks.js +41 -77
- package/dist/locks.js.map +1 -1
- package/dist/locks.test.js.map +1 -1
- package/dist/presentation.js +65 -106
- package/dist/presentation.js.map +1 -1
- package/dist/presentation.test.js.map +1 -1
- package/dist/serializer.js +4 -8
- package/dist/serializer.js.map +1 -1
- package/dist/test.js.map +1 -1
- package/dist/time.js +11 -14
- package/dist/time.js.map +1 -1
- package/dist/timeout.js +7 -8
- package/dist/timeout.js.map +1 -1
- package/dist/zones.js +58 -84
- package/dist/zones.js.map +1 -1
- package/dist.esm/clone.d.ts.map +1 -1
- package/dist.esm/clone.js +8 -2
- package/dist.esm/clone.js.map +1 -1
- package/package.json +2 -2
- package/src/clone.ts +12 -3
package/dist/console.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatConsole = exports.indentConsole = exports.interceptConsole = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
/**
|
|
6
5
|
* Intercept console messages emitted within the given function, allowing you to programmatically call the underlying raw console implementation (or not).
|
|
7
6
|
*
|
|
@@ -9,47 +8,22 @@ var tslib_1 = require("tslib");
|
|
|
9
8
|
* @param callback
|
|
10
9
|
*/
|
|
11
10
|
function interceptConsole(handler, callback) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _loop_1 = function (method) {
|
|
11
|
+
let methods = ['log', 'info', 'warn', 'error', 'debug', 'dir'];
|
|
12
|
+
let rawConsole = {};
|
|
13
|
+
let origConsole = {};
|
|
14
|
+
for (let method of methods) {
|
|
17
15
|
origConsole[method] = console[method];
|
|
18
16
|
rawConsole[method] = (console[method] || console.log).bind(console);
|
|
19
17
|
console[method] = function () {
|
|
20
18
|
handler(method, rawConsole[method], rawConsole, Array.from(arguments));
|
|
21
19
|
};
|
|
22
|
-
};
|
|
23
|
-
try {
|
|
24
|
-
for (var methods_1 = (0, tslib_1.__values)(methods), methods_1_1 = methods_1.next(); !methods_1_1.done; methods_1_1 = methods_1.next()) {
|
|
25
|
-
var method = methods_1_1.value;
|
|
26
|
-
_loop_1(method);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
30
|
-
finally {
|
|
31
|
-
try {
|
|
32
|
-
if (methods_1_1 && !methods_1_1.done && (_a = methods_1.return)) _a.call(methods_1);
|
|
33
|
-
}
|
|
34
|
-
finally { if (e_1) throw e_1.error; }
|
|
35
20
|
}
|
|
36
21
|
try {
|
|
37
22
|
callback();
|
|
38
23
|
}
|
|
39
24
|
finally {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var method = methods_2_1.value;
|
|
43
|
-
console[method] = origConsole[method];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
47
|
-
finally {
|
|
48
|
-
try {
|
|
49
|
-
if (methods_2_1 && !methods_2_1.done && (_b = methods_2.return)) _b.call(methods_2);
|
|
50
|
-
}
|
|
51
|
-
finally { if (e_2) throw e_2.error; }
|
|
52
|
-
}
|
|
25
|
+
for (let method of methods)
|
|
26
|
+
console[method] = origConsole[method];
|
|
53
27
|
}
|
|
54
28
|
}
|
|
55
29
|
exports.interceptConsole = interceptConsole;
|
|
@@ -61,19 +35,19 @@ exports.interceptConsole = interceptConsole;
|
|
|
61
35
|
* @param callback
|
|
62
36
|
*/
|
|
63
37
|
function indentConsole(spaces, callback) {
|
|
64
|
-
|
|
65
|
-
return interceptConsole(
|
|
38
|
+
let indent = Array(spaces).join(' ');
|
|
39
|
+
return interceptConsole((method, original, console, args) => {
|
|
66
40
|
if (method == 'dir') {
|
|
67
41
|
if (typeof require !== 'undefined') {
|
|
68
|
-
|
|
69
|
-
console.log(
|
|
42
|
+
const util = require('util');
|
|
43
|
+
console.log(`${indent}${util.inspect(args[0])}`);
|
|
70
44
|
}
|
|
71
45
|
else {
|
|
72
|
-
original
|
|
46
|
+
original(...args);
|
|
73
47
|
}
|
|
74
48
|
}
|
|
75
49
|
else {
|
|
76
|
-
original(
|
|
50
|
+
original(`${indent}${args.join(' ')}`);
|
|
77
51
|
}
|
|
78
52
|
}, callback);
|
|
79
53
|
}
|
|
@@ -86,18 +60,18 @@ exports.indentConsole = indentConsole;
|
|
|
86
60
|
* @param callback
|
|
87
61
|
*/
|
|
88
62
|
function formatConsole(formatter, callback) {
|
|
89
|
-
return interceptConsole(
|
|
63
|
+
return interceptConsole((method, original, console, args) => {
|
|
90
64
|
if (method == 'dir') {
|
|
91
65
|
if (typeof require !== 'undefined') {
|
|
92
|
-
|
|
93
|
-
console.log(
|
|
66
|
+
const util = require('util');
|
|
67
|
+
console.log(`${formatter(util.inspect(args[0]))}`);
|
|
94
68
|
}
|
|
95
69
|
else {
|
|
96
|
-
original
|
|
70
|
+
original(...args);
|
|
97
71
|
}
|
|
98
72
|
}
|
|
99
73
|
else {
|
|
100
|
-
original(
|
|
74
|
+
original(`${formatter(args.join(' '))}`);
|
|
101
75
|
}
|
|
102
76
|
}, callback);
|
|
103
77
|
}
|
package/dist/console.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sourceRoot":"","sources":["../src/console.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.js","sourceRoot":"","sources":["../src/console.ts"],"names":[],"mappings":";;;AAUA;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAA6F,EAAE,QAAmB;IAC/I,IAAI,OAAO,GAAG,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAE,CAAC;IAEjE,IAAI,UAAU,GAAa,EAAS,CAAC;IACrC,IAAI,WAAW,GAAG,EAAE,CAAC;IAErB,KAAK,IAAI,MAAM,IAAI,OAAO,EAAE;QACxB,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACtC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,OAAO,CAAC,MAAM,CAAC,GAAG;YACd,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC;KACL;IAED,IAAI;QACA,QAAQ,EAAE,CAAC;KACd;YAAS;QACN,KAAK,IAAI,MAAM,IAAI,OAAO;YACtB,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;K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;aAAM;YACH,QAAQ,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;SAC5C;IACL,CAAC,EAAE,QAAQ,CAAC,CAAC;AACjB,CAAC;AAbD,sCAaC"}
|
package/dist/decorators.js
CHANGED
package/dist/decorators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU;IACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU;IACtB,OAAO,MAAM,CAAC,EAAE,GAAE,CAAC,CAAC;AACxB,CAAC;AAFD,gCAEC"}
|
package/dist/environment.js
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Environment = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const decorators_1 = require("./decorators");
|
|
6
6
|
/**
|
|
7
7
|
* Access the environment variables of the current process.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
let Environment = class Environment {
|
|
10
|
+
constructor() {
|
|
11
11
|
this.env = typeof process !== 'undefined' ? process.env : {};
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
Environment.prototype.setup = function (defaults) {
|
|
13
|
+
get raw() {
|
|
14
|
+
return this.env;
|
|
15
|
+
}
|
|
16
|
+
setup(defaults) {
|
|
21
17
|
this.defaults = defaults;
|
|
22
|
-
}
|
|
23
|
-
|
|
18
|
+
}
|
|
19
|
+
get() {
|
|
24
20
|
return Object.assign({}, this.defaults, (typeof process !== 'undefined' ? process.env : null) || {});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}());
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
Environment = (0, tslib_1.__decorate)([
|
|
24
|
+
(0, decorators_1.Injectable)(),
|
|
25
|
+
(0, tslib_1.__metadata)("design:paramtypes", [])
|
|
26
|
+
], Environment);
|
|
32
27
|
exports.Environment = Environment;
|
|
33
28
|
//# sourceMappingURL=environment.js.map
|
package/dist/environment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;;AAAA,6CAA0C;AAE1C;;GAEG;AAEH,IAAa,WAAW,GAAxB,MAAa,WAAW;IACpB;QACI,IAAI,CAAC,GAAG,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,CAAC;IAKD,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,KAAK,CAAI,QAAqB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,GAAG;QACC,OAAO,MAAM,CAAC,MAAM,CAChB,EAAE,EACF,IAAI,CAAC,QAAQ,EACb,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CACrE,CAAC;IACN,CAAC;CACJ,CAAA;AAvBY,WAAW;IADvB,IAAA,uBAAU,GAAE;;GACA,WAAW,CAuBvB;AAvBY,kCAAW"}
|
package/dist/errors.js
CHANGED
|
@@ -1,197 +1,143 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpError = exports.AccessDeniedError = exports.InvalidOperationError = exports.FormatError = exports.IOError = exports.TimeoutError = exports.OperationCanceledError = exports.NotImplementedError = exports.NotSupportedError = exports.ArgumentOutOfRangeError = exports.ArgumentNullError = exports.ArgumentError = exports.ApplicationError = exports.SystemError = exports.BaseErrorT = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function BaseErrorT(message) {
|
|
4
|
+
class BaseErrorT {
|
|
5
|
+
constructor(message) {
|
|
7
6
|
this._message = message;
|
|
8
7
|
}
|
|
9
|
-
|
|
8
|
+
causedBy(error) {
|
|
10
9
|
this._innerError = error;
|
|
11
10
|
return this;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(BaseErrorT.prototype, "innerError", {
|
|
21
|
-
get: function () {
|
|
22
|
-
return this._innerError;
|
|
23
|
-
},
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
BaseErrorT.setJSONSerializer = function (serializer) {
|
|
11
|
+
}
|
|
12
|
+
get message() {
|
|
13
|
+
return this._message;
|
|
14
|
+
}
|
|
15
|
+
get innerError() {
|
|
16
|
+
return this._innerError;
|
|
17
|
+
}
|
|
18
|
+
static setJSONSerializer(serializer) {
|
|
28
19
|
this.serializer = serializer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var _this = this;
|
|
20
|
+
}
|
|
21
|
+
asJSON() {
|
|
32
22
|
if (BaseErrorT.serializer)
|
|
33
23
|
return BaseErrorT.serializer(this);
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
let ownKeys = Object.getOwnPropertyNames(this);
|
|
25
|
+
let repr = {
|
|
36
26
|
$type: this.constructor.name,
|
|
37
27
|
error: true,
|
|
38
28
|
message: this.message,
|
|
39
29
|
stack: this['stack']
|
|
40
30
|
};
|
|
41
|
-
|
|
42
|
-
.filter(
|
|
43
|
-
.filter(
|
|
44
|
-
.map(
|
|
45
|
-
.reduce(
|
|
31
|
+
let includedData = ownKeys
|
|
32
|
+
.filter(x => !x.startsWith('_'))
|
|
33
|
+
.filter(x => typeof this[x] !== 'function')
|
|
34
|
+
.map(x => [x, this[x]])
|
|
35
|
+
.reduce((pv, cv) => pv[cv[0]] = cv[1], {});
|
|
46
36
|
return Object.assign({}, repr, includedData);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}());
|
|
37
|
+
}
|
|
38
|
+
}
|
|
50
39
|
exports.BaseErrorT = BaseErrorT;
|
|
51
40
|
/**
|
|
52
41
|
* Base class for errors thrown by the system or framework
|
|
53
42
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
function SystemError() {
|
|
57
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
58
|
-
}
|
|
59
|
-
return SystemError;
|
|
60
|
-
}(BaseErrorT));
|
|
43
|
+
class SystemError extends BaseErrorT {
|
|
44
|
+
}
|
|
61
45
|
exports.SystemError = SystemError;
|
|
62
46
|
/**
|
|
63
47
|
* Base class for errors thrown by your application
|
|
64
48
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
function ApplicationError() {
|
|
68
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
|
-
}
|
|
70
|
-
return ApplicationError;
|
|
71
|
-
}(BaseErrorT));
|
|
49
|
+
class ApplicationError extends BaseErrorT {
|
|
50
|
+
}
|
|
72
51
|
exports.ApplicationError = ApplicationError;
|
|
73
|
-
|
|
74
|
-
(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return this._value;
|
|
86
|
-
},
|
|
87
|
-
enumerable: false,
|
|
88
|
-
configurable: true
|
|
89
|
-
});
|
|
90
|
-
ArgumentError.prototype.withValue = function (value) {
|
|
52
|
+
class ArgumentError extends SystemError {
|
|
53
|
+
constructor(argumentName, message) {
|
|
54
|
+
super(message || `Invalid value for argument ${argumentName}`);
|
|
55
|
+
this._argumentName = argumentName;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The invalid value passed for the given argument
|
|
59
|
+
*/
|
|
60
|
+
get value() {
|
|
61
|
+
return this._value;
|
|
62
|
+
}
|
|
63
|
+
withValue(value) {
|
|
91
64
|
this._value = value;
|
|
92
65
|
return this;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
enumerable: false,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
|
-
return ArgumentError;
|
|
105
|
-
}(SystemError));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The name of the argument
|
|
69
|
+
*/
|
|
70
|
+
get argumentName() {
|
|
71
|
+
return this._argumentName;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
106
74
|
exports.ArgumentError = ArgumentError;
|
|
107
|
-
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
return _super.call(this, argumentName, message || "Argument " + argumentName + " cannot be null") || this;
|
|
75
|
+
class ArgumentNullError extends ArgumentError {
|
|
76
|
+
constructor(argumentName, message) {
|
|
77
|
+
super(argumentName, message || `Argument ${argumentName} cannot be null`);
|
|
111
78
|
}
|
|
112
|
-
|
|
113
|
-
}(ArgumentError));
|
|
79
|
+
}
|
|
114
80
|
exports.ArgumentNullError = ArgumentNullError;
|
|
115
|
-
|
|
116
|
-
(
|
|
117
|
-
|
|
118
|
-
return _super.call(this, argumentName, message || "Argument " + argumentName + " is out of range") || this;
|
|
81
|
+
class ArgumentOutOfRangeError extends ArgumentError {
|
|
82
|
+
constructor(argumentName, message) {
|
|
83
|
+
super(argumentName, message || `Argument ${argumentName} is out of range`);
|
|
119
84
|
}
|
|
120
|
-
|
|
121
|
-
}(ArgumentError));
|
|
85
|
+
}
|
|
122
86
|
exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError;
|
|
123
|
-
|
|
124
|
-
(
|
|
125
|
-
|
|
126
|
-
return _super.call(this, message || "The requested operation is not supported.") || this;
|
|
87
|
+
class NotSupportedError extends SystemError {
|
|
88
|
+
constructor(message) {
|
|
89
|
+
super(message || `The requested operation is not supported.`);
|
|
127
90
|
}
|
|
128
|
-
|
|
129
|
-
}(SystemError));
|
|
91
|
+
}
|
|
130
92
|
exports.NotSupportedError = NotSupportedError;
|
|
131
|
-
|
|
132
|
-
(
|
|
133
|
-
|
|
134
|
-
return _super.call(this, message || "The requested operation is not implemented.") || this;
|
|
93
|
+
class NotImplementedError extends SystemError {
|
|
94
|
+
constructor(message) {
|
|
95
|
+
super(message || `The requested operation is not implemented.`);
|
|
135
96
|
}
|
|
136
|
-
|
|
137
|
-
}(SystemError));
|
|
97
|
+
}
|
|
138
98
|
exports.NotImplementedError = NotImplementedError;
|
|
139
|
-
|
|
140
|
-
(
|
|
141
|
-
|
|
142
|
-
return _super.call(this, message || "The requested operation is not implemented.") || this;
|
|
99
|
+
class OperationCanceledError extends SystemError {
|
|
100
|
+
constructor(message) {
|
|
101
|
+
super(message || `The requested operation is not implemented.`);
|
|
143
102
|
}
|
|
144
|
-
|
|
145
|
-
}(SystemError));
|
|
103
|
+
}
|
|
146
104
|
exports.OperationCanceledError = OperationCanceledError;
|
|
147
|
-
|
|
148
|
-
(
|
|
149
|
-
|
|
150
|
-
return _super.call(this, message || "The operation has timed out.") || this;
|
|
105
|
+
class TimeoutError extends SystemError {
|
|
106
|
+
constructor(message) {
|
|
107
|
+
super(message || `The operation has timed out.`);
|
|
151
108
|
}
|
|
152
|
-
|
|
153
|
-
}(SystemError));
|
|
109
|
+
}
|
|
154
110
|
exports.TimeoutError = TimeoutError;
|
|
155
|
-
|
|
156
|
-
(
|
|
157
|
-
|
|
158
|
-
return _super.call(this, message || "An I/O error has occurred.") || this;
|
|
111
|
+
class IOError extends SystemError {
|
|
112
|
+
constructor(message) {
|
|
113
|
+
super(message || `An I/O error has occurred.`);
|
|
159
114
|
}
|
|
160
|
-
|
|
161
|
-
}(SystemError));
|
|
115
|
+
}
|
|
162
116
|
exports.IOError = IOError;
|
|
163
|
-
|
|
164
|
-
(
|
|
165
|
-
|
|
166
|
-
return _super.call(this, message || "Invalid format.") || this;
|
|
117
|
+
class FormatError extends SystemError {
|
|
118
|
+
constructor(message) {
|
|
119
|
+
super(message || `Invalid format.`);
|
|
167
120
|
}
|
|
168
|
-
|
|
169
|
-
}(SystemError));
|
|
121
|
+
}
|
|
170
122
|
exports.FormatError = FormatError;
|
|
171
|
-
|
|
172
|
-
(
|
|
173
|
-
|
|
174
|
-
return _super.call(this, message || "Invalid format.") || this;
|
|
123
|
+
class InvalidOperationError extends SystemError {
|
|
124
|
+
constructor(message) {
|
|
125
|
+
super(message || `Invalid format.`);
|
|
175
126
|
}
|
|
176
|
-
|
|
177
|
-
}(SystemError));
|
|
127
|
+
}
|
|
178
128
|
exports.InvalidOperationError = InvalidOperationError;
|
|
179
|
-
|
|
180
|
-
(
|
|
181
|
-
|
|
182
|
-
return _super.call(this, message || "Invalid format.") || this;
|
|
129
|
+
class AccessDeniedError extends SystemError {
|
|
130
|
+
constructor(message) {
|
|
131
|
+
super(message || `Invalid format.`);
|
|
183
132
|
}
|
|
184
|
-
|
|
185
|
-
}(SystemError));
|
|
133
|
+
}
|
|
186
134
|
exports.AccessDeniedError = AccessDeniedError;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (headers === void 0) { headers = []; }
|
|
135
|
+
class HttpError {
|
|
136
|
+
constructor(statusCode, body, headers = []) {
|
|
190
137
|
this.statusCode = statusCode;
|
|
191
138
|
this.body = body;
|
|
192
139
|
this.headers = headers;
|
|
193
140
|
}
|
|
194
|
-
|
|
195
|
-
}());
|
|
141
|
+
}
|
|
196
142
|
exports.HttpError = HttpError;
|
|
197
143
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IACnB,YAAY,OAAgB;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAKO,QAAQ,CAAC,KAAiB;QAC9B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAGD,MAAM,CAAC,iBAAiB,CAAC,UAAoC;QACzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,MAAM;QACF,IAAI,UAAU,CAAC,UAAU;YACrB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,IAAI,GAAG;YACP,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;YAC5B,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACvB,CAAC;QAEF,IAAI,YAAY,GAAG,OAAO;aACrB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,IAAI,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FzB,eAAU,GAAV,UAAU,CAAS;QACnB,SAAI,GAAJ,IAAI,CAAM;QACV,YAAO,GAAP,OAAO,CAAkB;IAEvC,CAAC;CACD;AAPD,8BAOC"}
|
package/dist/errors.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../src/errors.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../src/errors.test.ts"],"names":[],"mappings":";;AAAA,mCAA+B;AAE/B,IAAA,cAAK,EAAC,QAAQ,CAAC,EAAE;IACb,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE;QACpB,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YACtB,8BAA8B;QAClC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAA"}
|
package/dist/get-param-names.js
CHANGED
|
@@ -5,33 +5,33 @@ exports.getParameterNames = void 0;
|
|
|
5
5
|
/**
|
|
6
6
|
* @hidden
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
let COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
let DEFAULT_PARAMS = /=[^,)]+/mg;
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
let FAT_ARROWS = /=>.*$/mg;
|
|
17
17
|
/**
|
|
18
18
|
* @hidden
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
let SPACES = /\s/mg;
|
|
21
21
|
/**
|
|
22
22
|
* @hidden
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
let BEFORE_OPENING_PAREN = /^[^(]*\(/mg;
|
|
25
25
|
/**
|
|
26
26
|
* @hidden
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
let AFTER_CLOSING_PAREN = /^([^)]*)\).*$/mg;
|
|
29
29
|
/**
|
|
30
30
|
* Get the names of the parameters of the given function.
|
|
31
31
|
* @param fn
|
|
32
32
|
*/
|
|
33
33
|
function getParameterNames(fn) {
|
|
34
|
-
|
|
34
|
+
let code = fn.toString()
|
|
35
35
|
.replace(SPACES, '')
|
|
36
36
|
.replace(COMMENTS, '')
|
|
37
37
|
.replace(FAT_ARROWS, '')
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
4
|
(0, tslib_1.__exportStar)(require("./zones"), exports);
|
|
5
5
|
(0, tslib_1.__exportStar)(require("./clone"), exports);
|
|
6
6
|
(0, tslib_1.__exportStar)(require("./coalesce"), exports);
|
package/dist/lazy-promise.js
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LazyPromise = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
/**
|
|
6
5
|
* A promise that lets you wait until someone actually requests the result of the promise to kick off
|
|
7
6
|
* the action being promised. This lets you return the promise before you start executing the async action.
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_this.fulfiller = fulfiller;
|
|
17
|
-
return _this;
|
|
8
|
+
class LazyPromise extends Promise {
|
|
9
|
+
constructor(fulfiller) {
|
|
10
|
+
super((resolve, reject) => {
|
|
11
|
+
this._resolve = resolve;
|
|
12
|
+
this._reject = reject;
|
|
13
|
+
});
|
|
14
|
+
this.fulfiller = fulfiller;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
var _this = this;
|
|
16
|
+
fulfill() {
|
|
21
17
|
if (!this.realPromise) {
|
|
22
18
|
this.realPromise = this.fulfiller()
|
|
23
|
-
.then(
|
|
24
|
-
.catch(
|
|
19
|
+
.then(v => this._resolve(v))
|
|
20
|
+
.catch(e => this._reject(e));
|
|
25
21
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
22
|
+
}
|
|
23
|
+
then(onfulfilled, onrejected) {
|
|
28
24
|
this.fulfill();
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
|
|
25
|
+
return super.then(onfulfilled, onrejected);
|
|
26
|
+
}
|
|
27
|
+
catch(onrejected) {
|
|
32
28
|
this.fulfill();
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}(Promise));
|
|
29
|
+
return super.catch(onrejected);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
37
32
|
exports.LazyPromise = LazyPromise;
|
|
38
33
|
//# sourceMappingURL=lazy-promise.js.map
|
package/dist/lazy-promise.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-promise.js","sourceRoot":"","sources":["../src/lazy-promise.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy-promise.js","sourceRoot":"","sources":["../src/lazy-promise.ts"],"names":[],"mappings":";;;AACA;;;GAGG;AACH,MAAa,WAAe,SAAQ,OAAU;IAC1C,YACY,SAA4B;QAEpC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;QALK,cAAS,GAAT,SAAS,CAAmB;IAOxC,CAAC;IAKD,OAAO;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE;iBAC9B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAC/B;SACJ;IACL,CAAC;IAID,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACvM,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAkB,UAAiF;QACpG,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;CACJ;AAlCD,kCAkCC"}
|