@nr1e/commons 0.0.3-alpha.7 → 0.0.3-alpha.9
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/{bitsnbytes → dist/bitsnbytes}/b64.js +14 -21
- package/dist/bitsnbytes/b64.js.map +1 -0
- package/dist/bitsnbytes/index.js +2 -0
- package/dist/bitsnbytes/index.js.map +1 -0
- package/{errors → dist/errors}/errors.js +43 -69
- package/dist/errors/errors.js.map +1 -0
- package/dist/errors/index.js +2 -0
- package/dist/errors/index.js.map +1 -0
- package/{http → dist/http}/http-method.js +2 -5
- package/dist/http/http-method.js.map +1 -0
- package/{http → dist/http}/http-status-code.js +2 -5
- package/dist/http/http-status-code.js.map +1 -0
- package/dist/http/index.js +3 -0
- package/dist/http/index.js.map +1 -0
- package/{lang → dist/lang}/index.d.ts +1 -0
- package/dist/lang/index.js +3 -0
- package/dist/lang/index.js.map +1 -0
- package/dist/lang/sleep.d.ts +6 -0
- package/dist/lang/sleep.js +9 -0
- package/dist/lang/sleep.js.map +1 -0
- package/dist/lang/type-functions.js +10 -0
- package/dist/lang/type-functions.js.map +1 -0
- package/dist/validator/index.js +2 -0
- package/dist/validator/index.js.map +1 -0
- package/{validator → dist/validator}/validators.js +37 -64
- package/dist/validator/validators.js.map +1 -0
- package/package.json +7 -7
- package/.prettierrc.js +0 -3
- package/bitsnbytes/b64.js.map +0 -1
- package/bitsnbytes/index.js +0 -18
- package/bitsnbytes/index.js.map +0 -1
- package/errors/errors.js.map +0 -1
- package/errors/index.js +0 -18
- package/errors/index.js.map +0 -1
- package/http/http-method.js.map +0 -1
- package/http/http-status-code.js.map +0 -1
- package/http/index.js +0 -19
- package/http/index.js.map +0 -1
- package/index.d.ts +0 -5
- package/index.js +0 -9
- package/index.js.map +0 -1
- package/jest.config.js +0 -8
- package/lang/index.js +0 -18
- package/lang/index.js.map +0 -1
- package/lang/type-functions.js +0 -16
- package/lang/type-functions.js.map +0 -1
- package/validator/index.js +0 -18
- package/validator/index.js.map +0 -1
- package/validator/validators.js.map +0 -1
- /package/{bitsnbytes → dist/bitsnbytes}/b64.d.ts +0 -0
- /package/{bitsnbytes → dist/bitsnbytes}/index.d.ts +0 -0
- /package/{errors → dist/errors}/errors.d.ts +0 -0
- /package/{errors → dist/errors}/index.d.ts +0 -0
- /package/{http → dist/http}/http-method.d.ts +0 -0
- /package/{http → dist/http}/http-status-code.d.ts +0 -0
- /package/{http → dist/http}/index.d.ts +0 -0
- /package/{lang → dist/lang}/type-functions.d.ts +0 -0
- /package/{validator → dist/validator}/index.d.ts +0 -0
- /package/{validator → dist/validator}/validators.d.ts +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stob64s = exports.tob64s = exports.tob64 = exports.b64Charset = exports.YUI_BASE64_CHARS = exports.URL_MODIFIED_BASE64_CHARS = exports.BASE64_CHARS = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
1
|
+
import { IllegalArgumentError } from '../errors';
|
|
5
2
|
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
6
3
|
const encoder = new TextEncoder();
|
|
7
4
|
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
8
5
|
const decoder = new TextDecoder();
|
|
9
|
-
|
|
6
|
+
export const BASE64_CHARS = new Uint8Array([
|
|
10
7
|
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
|
|
11
8
|
0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
|
|
12
9
|
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d,
|
|
@@ -18,7 +15,7 @@ exports.BASE64_CHARS = new Uint8Array([
|
|
|
18
15
|
// 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
|
19
16
|
// 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
|
20
17
|
// '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '='
|
|
21
|
-
|
|
18
|
+
export const URL_MODIFIED_BASE64_CHARS = new Uint8Array([
|
|
22
19
|
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
|
|
23
20
|
0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
|
|
24
21
|
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d,
|
|
@@ -30,7 +27,7 @@ exports.URL_MODIFIED_BASE64_CHARS = new Uint8Array([
|
|
|
30
27
|
// 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
|
31
28
|
// 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
|
32
29
|
// '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
|
|
33
|
-
|
|
30
|
+
export const YUI_BASE64_CHARS = new Uint8Array([
|
|
34
31
|
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
|
|
35
32
|
0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
|
|
36
33
|
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d,
|
|
@@ -42,28 +39,27 @@ exports.YUI_BASE64_CHARS = new Uint8Array([
|
|
|
42
39
|
*
|
|
43
40
|
* @param b64chars a base64 character set
|
|
44
41
|
*/
|
|
45
|
-
function b64Charset(b64chars) {
|
|
42
|
+
export function b64Charset(b64chars) {
|
|
46
43
|
if (b64chars === undefined || b64chars === null) {
|
|
47
|
-
return
|
|
44
|
+
return BASE64_CHARS;
|
|
48
45
|
}
|
|
49
46
|
if (b64chars instanceof Uint8Array) {
|
|
50
47
|
if (b64chars.length !== 65 && b64chars.length !== 64) {
|
|
51
|
-
throw new
|
|
48
|
+
throw new IllegalArgumentError('b64chars', 'Base 64 character sets must be 64 or 65 characters.');
|
|
52
49
|
}
|
|
53
50
|
return b64chars;
|
|
54
51
|
}
|
|
55
52
|
switch (b64chars) {
|
|
56
53
|
case 'b64':
|
|
57
|
-
return
|
|
54
|
+
return BASE64_CHARS;
|
|
58
55
|
case 'url':
|
|
59
|
-
return
|
|
56
|
+
return URL_MODIFIED_BASE64_CHARS;
|
|
60
57
|
case 'yui':
|
|
61
|
-
return
|
|
58
|
+
return YUI_BASE64_CHARS;
|
|
62
59
|
default:
|
|
63
|
-
throw new
|
|
60
|
+
throw new IllegalArgumentError('b64chars', `Invalid base64 character set '${b64chars}'`);
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
|
-
exports.b64Charset = b64Charset;
|
|
67
63
|
/**
|
|
68
64
|
* Base64 encodes a series of bytes.
|
|
69
65
|
*
|
|
@@ -71,7 +67,7 @@ exports.b64Charset = b64Charset;
|
|
|
71
67
|
* @param opts Encoding options
|
|
72
68
|
* @return a base64 string
|
|
73
69
|
*/
|
|
74
|
-
function tob64(buf, opts) {
|
|
70
|
+
export function tob64(buf, opts) {
|
|
75
71
|
var _a, _b;
|
|
76
72
|
const b64chars = b64Charset(opts === null || opts === void 0 ? void 0 : opts.b64chars);
|
|
77
73
|
const toIndex = (_a = opts === null || opts === void 0 ? void 0 : opts.toIndex) !== null && _a !== void 0 ? _a : buf.length;
|
|
@@ -111,7 +107,6 @@ function tob64(buf, opts) {
|
|
|
111
107
|
}
|
|
112
108
|
return b64;
|
|
113
109
|
}
|
|
114
|
-
exports.tob64 = tob64;
|
|
115
110
|
/**
|
|
116
111
|
* Base64 encodes a series of bytes to a string.
|
|
117
112
|
*
|
|
@@ -119,10 +114,9 @@ exports.tob64 = tob64;
|
|
|
119
114
|
* @param opts Encoding options
|
|
120
115
|
* @return a base64 string
|
|
121
116
|
*/
|
|
122
|
-
function tob64s(buf, opts) {
|
|
117
|
+
export function tob64s(buf, opts) {
|
|
123
118
|
return decoder.decode(tob64(buf, opts));
|
|
124
119
|
}
|
|
125
|
-
exports.tob64s = tob64s;
|
|
126
120
|
/**
|
|
127
121
|
* Base64 encodes a string to a string.
|
|
128
122
|
*
|
|
@@ -130,8 +124,7 @@ exports.tob64s = tob64s;
|
|
|
130
124
|
* @param opts Encoding options
|
|
131
125
|
* @return a base64 string
|
|
132
126
|
*/
|
|
133
|
-
function stob64s(str, opts) {
|
|
127
|
+
export function stob64s(str, opts) {
|
|
134
128
|
return tob64s(encoder.encode(str), opts);
|
|
135
129
|
}
|
|
136
|
-
exports.stob64s = stob64s;
|
|
137
130
|
//# sourceMappingURL=b64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"b64.js","sourceRoot":"./src/","sources":["bitsnbytes/b64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAE/C,sEAAsE;AACtE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,sEAAsE;AACtE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,YAAY,GAAe,IAAI,UAAU,CAAC;IACrD,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC5E,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,I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xB,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;iBACzB;gBACD,MAAM;YACR,KAAK,CAAC,EAAE,yBAAyB;gBAC/B,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;gBACtC,IAAI,QAAQ,CAAC,MAAM,KAAK,EAAE,EAAE;oBAC1B,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;iBACzB;gBACD,MAAM;YACR;gBACE,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;gBACtC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;gBAC9B,MAAM;SACT;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,GAAe,EAAE,IAAoB;IAC1D,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,IAAoB;IACvD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["bitsnbytes/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -1,214 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const http_1 = require("../http");
|
|
5
|
-
const lang_1 = require("../lang");
|
|
6
|
-
var lang_2 = require("../lang");
|
|
7
|
-
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return lang_2.isError; } });
|
|
1
|
+
import { HttpStatusCode } from '../http';
|
|
2
|
+
import { isError, isObject } from '../lang';
|
|
3
|
+
export { isError } from '../lang';
|
|
8
4
|
/**
|
|
9
5
|
* Checks if the given parameter is an HttpError.
|
|
10
6
|
*
|
|
11
7
|
* @param e The parameter to check
|
|
12
8
|
*/
|
|
13
|
-
function isHttpError(e) {
|
|
14
|
-
return
|
|
9
|
+
export function isHttpError(e) {
|
|
10
|
+
return isObject(e) && !!(e && e.stack && e.statusCode && e.message && e.name);
|
|
15
11
|
}
|
|
16
|
-
exports.isHttpError = isHttpError;
|
|
17
12
|
/**
|
|
18
13
|
* Thrown when a resource cannot be found.
|
|
19
14
|
*/
|
|
20
|
-
class NotFoundError extends Error {
|
|
15
|
+
export class NotFoundError extends Error {
|
|
21
16
|
constructor(message, maxAge) {
|
|
22
17
|
message = message !== null && message !== void 0 ? message : 'Not found';
|
|
23
18
|
super(message);
|
|
24
|
-
this.statusCode =
|
|
19
|
+
this.statusCode = HttpStatusCode.NOT_FOUND;
|
|
25
20
|
this.name = 'NotFoundError';
|
|
26
21
|
this.maxAge = maxAge;
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
|
-
exports.NotFoundError = NotFoundError;
|
|
30
24
|
/**
|
|
31
25
|
* Checks if the given parameter is a NotFoundError.
|
|
32
26
|
*
|
|
33
27
|
* @param e The parameter to check
|
|
34
28
|
*/
|
|
35
|
-
function isNotFoundError(e) {
|
|
29
|
+
export function isNotFoundError(e) {
|
|
36
30
|
return isHttpError(e) && e.name === 'NotFoundError';
|
|
37
31
|
}
|
|
38
|
-
exports.isNotFoundError = isNotFoundError;
|
|
39
32
|
/**
|
|
40
33
|
* Thrown when a request is missing authentication credentials.
|
|
41
34
|
*/
|
|
42
|
-
class UnauthorizedError extends Error {
|
|
35
|
+
export class UnauthorizedError extends Error {
|
|
43
36
|
constructor(message) {
|
|
44
37
|
message = message !== null && message !== void 0 ? message : 'Unauthorized';
|
|
45
38
|
super(message);
|
|
46
|
-
this.statusCode =
|
|
39
|
+
this.statusCode = HttpStatusCode.UNAUTHORIZED;
|
|
47
40
|
this.name = 'UnauthorizedError';
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
|
-
exports.UnauthorizedError = UnauthorizedError;
|
|
51
43
|
/**
|
|
52
44
|
* Checks if the given parameter is a UnauthorizedError.
|
|
53
45
|
*
|
|
54
46
|
* @param e The parameter to check
|
|
55
47
|
*/
|
|
56
|
-
function isUnauthorizedError(e) {
|
|
48
|
+
export function isUnauthorizedError(e) {
|
|
57
49
|
return isHttpError(e) && e.name === 'UnauthorizedError';
|
|
58
50
|
}
|
|
59
|
-
exports.isUnauthorizedError = isUnauthorizedError;
|
|
60
51
|
/**
|
|
61
52
|
* Thrown when credentials are present, but the requested operations is not allowed.
|
|
62
53
|
*/
|
|
63
|
-
class ForbiddenError extends Error {
|
|
54
|
+
export class ForbiddenError extends Error {
|
|
64
55
|
constructor(message) {
|
|
65
56
|
message = message !== null && message !== void 0 ? message : 'Forbidden';
|
|
66
57
|
super(message);
|
|
67
|
-
this.statusCode =
|
|
58
|
+
this.statusCode = HttpStatusCode.FORBIDDEN;
|
|
68
59
|
this.name = 'ForbiddenError';
|
|
69
60
|
}
|
|
70
61
|
}
|
|
71
|
-
exports.ForbiddenError = ForbiddenError;
|
|
72
62
|
/**
|
|
73
63
|
* Checks if the given parameter is a ForbiddenError.
|
|
74
64
|
*
|
|
75
65
|
* @param e The parameter to check
|
|
76
66
|
*/
|
|
77
|
-
function isForbiddenError(e) {
|
|
67
|
+
export function isForbiddenError(e) {
|
|
78
68
|
return isHttpError(e) && e.name === 'ForbiddenError';
|
|
79
69
|
}
|
|
80
|
-
exports.isForbiddenError = isForbiddenError;
|
|
81
70
|
/**
|
|
82
71
|
* Thrown when a validation error occurs.
|
|
83
72
|
*/
|
|
84
|
-
class ValidationError extends Error {
|
|
73
|
+
export class ValidationError extends Error {
|
|
85
74
|
constructor(message) {
|
|
86
75
|
message = message !== null && message !== void 0 ? message : 'Validation error';
|
|
87
76
|
super(message);
|
|
88
|
-
this.statusCode =
|
|
77
|
+
this.statusCode = HttpStatusCode.BAD_REQUEST;
|
|
89
78
|
this.name = 'ValidationError';
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
|
-
exports.ValidationError = ValidationError;
|
|
93
81
|
/**
|
|
94
82
|
* Checks if the given variable is a ValidationError.
|
|
95
83
|
*
|
|
96
84
|
* @param e The variable to check
|
|
97
85
|
*/
|
|
98
|
-
function isValidationError(e) {
|
|
86
|
+
export function isValidationError(e) {
|
|
99
87
|
return isHttpError(e) && e.name === 'ValidationError';
|
|
100
88
|
}
|
|
101
|
-
exports.isValidationError = isValidationError;
|
|
102
89
|
/**
|
|
103
90
|
* Thrown when a bad request is made.
|
|
104
91
|
*/
|
|
105
|
-
class BadRequestError extends Error {
|
|
92
|
+
export class BadRequestError extends Error {
|
|
106
93
|
constructor(message) {
|
|
107
94
|
message = message !== null && message !== void 0 ? message : 'Bad request';
|
|
108
95
|
super(message !== null && message !== void 0 ? message : 'Bad request');
|
|
109
|
-
this.statusCode =
|
|
96
|
+
this.statusCode = HttpStatusCode.BAD_REQUEST;
|
|
110
97
|
this.name = 'BadRequestError';
|
|
111
98
|
}
|
|
112
99
|
}
|
|
113
|
-
exports.BadRequestError = BadRequestError;
|
|
114
100
|
/**
|
|
115
101
|
* Checks if the given parameter is a BadRequestError.
|
|
116
102
|
*
|
|
117
103
|
* @param e The parameter to check
|
|
118
104
|
*/
|
|
119
|
-
function isBadRequestError(e) {
|
|
105
|
+
export function isBadRequestError(e) {
|
|
120
106
|
return isHttpError(e) && e.name === 'BadRequestError';
|
|
121
107
|
}
|
|
122
|
-
exports.isBadRequestError = isBadRequestError;
|
|
123
108
|
/**
|
|
124
109
|
* Throws when an internal server error occurs.
|
|
125
110
|
*/
|
|
126
|
-
class InternalServerError extends Error {
|
|
111
|
+
export class InternalServerError extends Error {
|
|
127
112
|
constructor(message) {
|
|
128
113
|
message = message !== null && message !== void 0 ? message : 'Internal server error';
|
|
129
114
|
super(message);
|
|
130
|
-
this.statusCode =
|
|
115
|
+
this.statusCode = HttpStatusCode.INTERNAL_SERVER_ERROR;
|
|
131
116
|
this.name = 'InternalServerError';
|
|
132
117
|
}
|
|
133
118
|
}
|
|
134
|
-
exports.InternalServerError = InternalServerError;
|
|
135
119
|
/**
|
|
136
120
|
* Checks if the given parameter is a InternalServerError.
|
|
137
121
|
*
|
|
138
122
|
* @param e The parameter to check
|
|
139
123
|
*/
|
|
140
|
-
function isInternalServerError(e) {
|
|
124
|
+
export function isInternalServerError(e) {
|
|
141
125
|
return isHttpError(e) && e.name === 'InternalServerError';
|
|
142
126
|
}
|
|
143
|
-
exports.isInternalServerError = isInternalServerError;
|
|
144
127
|
/**
|
|
145
128
|
* Thrown when a conflict occurs.
|
|
146
129
|
*/
|
|
147
|
-
class ConflictError extends Error {
|
|
130
|
+
export class ConflictError extends Error {
|
|
148
131
|
constructor(message) {
|
|
149
132
|
message = message !== null && message !== void 0 ? message : 'Conflict';
|
|
150
133
|
super(message);
|
|
151
|
-
this.statusCode =
|
|
134
|
+
this.statusCode = HttpStatusCode.CONFLICT;
|
|
152
135
|
this.name = 'ConflictError';
|
|
153
136
|
}
|
|
154
137
|
}
|
|
155
|
-
exports.ConflictError = ConflictError;
|
|
156
138
|
/**
|
|
157
139
|
* Checks if the given parameter is a ConflictError.
|
|
158
140
|
*
|
|
159
141
|
* @param e The parameter to check
|
|
160
142
|
*/
|
|
161
|
-
function isConflictError(e) {
|
|
143
|
+
export function isConflictError(e) {
|
|
162
144
|
return isHttpError(e) && e.name === 'ConflictError';
|
|
163
145
|
}
|
|
164
|
-
exports.isConflictError = isConflictError;
|
|
165
146
|
/**
|
|
166
147
|
* Thrown when a unsupported media type is used.
|
|
167
148
|
*/
|
|
168
|
-
class UnsupportedMediaTypeError extends Error {
|
|
149
|
+
export class UnsupportedMediaTypeError extends Error {
|
|
169
150
|
constructor(message) {
|
|
170
151
|
message = message !== null && message !== void 0 ? message : 'Unsupported media type';
|
|
171
152
|
super(message);
|
|
172
|
-
this.statusCode =
|
|
153
|
+
this.statusCode = HttpStatusCode.UNSUPPORTED_MEDIA_TYPE;
|
|
173
154
|
this.name = 'UnsupportedMediaTypeError';
|
|
174
155
|
}
|
|
175
156
|
}
|
|
176
|
-
exports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;
|
|
177
157
|
/**
|
|
178
158
|
* Checks if the given parameter is a UnsupportedMediaTypeError.
|
|
179
159
|
*
|
|
180
160
|
* @param e The parameter to check
|
|
181
161
|
*/
|
|
182
|
-
function isUnsupportedMediaTypeError(e) {
|
|
162
|
+
export function isUnsupportedMediaTypeError(e) {
|
|
183
163
|
return isHttpError(e) && e.name === 'UnsupportedMediaTypeError';
|
|
184
164
|
}
|
|
185
|
-
exports.isUnsupportedMediaTypeError = isUnsupportedMediaTypeError;
|
|
186
165
|
/**
|
|
187
166
|
* Thrown when a requested operation is not implemented.
|
|
188
167
|
*/
|
|
189
|
-
class NotImplementedError extends Error {
|
|
168
|
+
export class NotImplementedError extends Error {
|
|
190
169
|
constructor(message) {
|
|
191
170
|
message = message !== null && message !== void 0 ? message : 'Not implemented';
|
|
192
171
|
super(message);
|
|
193
|
-
this.statusCode =
|
|
172
|
+
this.statusCode = HttpStatusCode.NOT_IMPLEMENTED;
|
|
194
173
|
this.expose = true;
|
|
195
174
|
this.name = 'NotImplementedError';
|
|
196
175
|
}
|
|
197
176
|
}
|
|
198
|
-
exports.NotImplementedError = NotImplementedError;
|
|
199
177
|
/**
|
|
200
178
|
* Checks if the given parameter is a NotImplementedError.
|
|
201
179
|
*
|
|
202
180
|
* @param e The parameter to check
|
|
203
181
|
*/
|
|
204
|
-
function isNotImplementedError(e) {
|
|
182
|
+
export function isNotImplementedError(e) {
|
|
205
183
|
return isHttpError(e) && e.name === 'NotImplementedError';
|
|
206
184
|
}
|
|
207
|
-
exports.isNotImplementedError = isNotImplementedError;
|
|
208
185
|
/**
|
|
209
186
|
* Thrown when an illegal argument is passed to a function.
|
|
210
187
|
*/
|
|
211
|
-
class IllegalArgumentError extends Error {
|
|
188
|
+
export class IllegalArgumentError extends Error {
|
|
212
189
|
constructor(argName, message) {
|
|
213
190
|
message = message !== null && message !== void 0 ? message : `Illegal argument ${argName}`;
|
|
214
191
|
super(message);
|
|
@@ -216,41 +193,38 @@ class IllegalArgumentError extends Error {
|
|
|
216
193
|
this.name = 'IllegalArgumentError';
|
|
217
194
|
}
|
|
218
195
|
}
|
|
219
|
-
exports.IllegalArgumentError = IllegalArgumentError;
|
|
220
196
|
/**
|
|
221
197
|
* Checks if the given parameter is a IllegalArgumentError.
|
|
222
198
|
*
|
|
223
199
|
* @param e The parameter to check
|
|
224
200
|
*/
|
|
225
|
-
function isIllegalArgumentError(e) {
|
|
226
|
-
return
|
|
201
|
+
export function isIllegalArgumentError(e) {
|
|
202
|
+
return isError(e) && e.name === 'IllegalArgumentError';
|
|
227
203
|
}
|
|
228
|
-
exports.isIllegalArgumentError = isIllegalArgumentError;
|
|
229
204
|
/**
|
|
230
205
|
* Converts the given parameter to an HttpError.
|
|
231
206
|
*
|
|
232
207
|
* @param code The HTTP status code
|
|
233
208
|
* @param message The error message
|
|
234
209
|
*/
|
|
235
|
-
function toError(code, message) {
|
|
210
|
+
export function toError(code, message) {
|
|
236
211
|
switch (code) {
|
|
237
|
-
case
|
|
212
|
+
case HttpStatusCode.NOT_FOUND:
|
|
238
213
|
return new NotFoundError(message);
|
|
239
|
-
case
|
|
214
|
+
case HttpStatusCode.FORBIDDEN:
|
|
240
215
|
return new ForbiddenError(message);
|
|
241
|
-
case
|
|
216
|
+
case HttpStatusCode.BAD_REQUEST:
|
|
242
217
|
return new BadRequestError(message);
|
|
243
|
-
case
|
|
218
|
+
case HttpStatusCode.INTERNAL_SERVER_ERROR:
|
|
244
219
|
return new InternalServerError(message);
|
|
245
|
-
case
|
|
220
|
+
case HttpStatusCode.CONFLICT:
|
|
246
221
|
return new ConflictError(message);
|
|
247
|
-
case
|
|
222
|
+
case HttpStatusCode.UNSUPPORTED_MEDIA_TYPE:
|
|
248
223
|
return new UnsupportedMediaTypeError(message);
|
|
249
|
-
case
|
|
224
|
+
case HttpStatusCode.NOT_IMPLEMENTED:
|
|
250
225
|
return new NotImplementedError(message);
|
|
251
226
|
default:
|
|
252
227
|
return new Error(message);
|
|
253
228
|
}
|
|
254
229
|
}
|
|
255
|
-
exports.toError = toError;
|
|
256
230
|
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"./src/","sources":["errors/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AACvC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAahC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,CAAW;IACrC,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAMtC,YAAY,OAAgB,EAAE,MAAe;QAC3C,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,WAAW,CAAC;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAPR,eAAU,GAAG,cAAc,CAAC,SAAS,CAAC;QAQ7C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAW;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ports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpMethod = void 0;
|
|
4
|
-
var HttpMethod;
|
|
1
|
+
export var HttpMethod;
|
|
5
2
|
(function (HttpMethod) {
|
|
6
3
|
HttpMethod["GET"] = "GET";
|
|
7
4
|
HttpMethod["POST"] = "POST";
|
|
@@ -10,5 +7,5 @@ var HttpMethod;
|
|
|
10
7
|
HttpMethod["DELETE"] = "DELETE";
|
|
11
8
|
HttpMethod["HEAD"] = "HEAD";
|
|
12
9
|
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
13
|
-
})(HttpMethod || (
|
|
10
|
+
})(HttpMethod || (HttpMethod = {}));
|
|
14
11
|
//# sourceMappingURL=http-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-method.js","sourceRoot":"./src/","sources":["http/http-method.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;AACrB,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpStatusCode = void 0;
|
|
4
|
-
var HttpStatusCode;
|
|
1
|
+
export var HttpStatusCode;
|
|
5
2
|
(function (HttpStatusCode) {
|
|
6
3
|
HttpStatusCode[HttpStatusCode["CONTINUE"] = 100] = "CONTINUE";
|
|
7
4
|
HttpStatusCode[HttpStatusCode["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
@@ -43,5 +40,5 @@ var HttpStatusCode;
|
|
|
43
40
|
HttpStatusCode[HttpStatusCode["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
44
41
|
HttpStatusCode[HttpStatusCode["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
45
42
|
HttpStatusCode[HttpStatusCode["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
46
|
-
})(HttpStatusCode || (
|
|
43
|
+
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
47
44
|
//# sourceMappingURL=http-status-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status-code.js","sourceRoot":"./src/","sources":["http/http-status-code.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAyCX;AAzCD,WAAY,cAAc;IACxB,6DAAc,CAAA;IACd,mFAAyB,CAAA;IACzB,iDAAQ,CAAA;IACR,2DAAa,CAAA;IACb,6DAAc,CAAA;IACd,uGAAmC,CAAA;IACnC,iEAAgB,CAAA;IAChB,uEAAmB,CAAA;IACnB,2EAAqB,CAAA;IACrB,6EAAsB,CAAA;IACtB,iFAAwB,CAAA;IACxB,uDAAW,CAAA;IACX,+DAAe,CAAA;IACf,qEAAkB,CAAA;IAClB,+DAAe,CAAA;IACf,iFAAwB,CAAA;IACxB,mEAAiB,CAAA;IACjB,qEAAkB,CAAA;IAClB,6EAAsB,CAAA;IACtB,+DAAe,CAAA;IACf,+DAAe,CAAA;IACf,iFAAwB,CAAA;IACxB,yEAAoB,CAAA;IACpB,uGAAmC,CAAA;IACnC,2EAAqB,CAAA;IACrB,6DAAc,CAAA;IACd,qDAAU,CAAA;IACV,2EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,6FAA8B,CAAA;IAC9B,qFAA0B,CAAA;IAC1B,yFAA4B,CAAA;IAC5B,uFAA2B,CAAA;IAC3B,iFAAwB,CAAA;IACxB,uFAA2B,CAAA;IAC3B,2EAAqB,CAAA;IACrB,mEAAiB,CAAA;IACjB,mFAAyB,CAAA;IACzB,2EAAqB,CAAA;IACrB,iGAAgC,CAAA;AAClC,CAAC,EAzCW,cAAc,KAAd,cAAc,QAyCzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["http/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["lang/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"./src/","sources":["lang/sleep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function isObject(item) {
|
|
2
|
+
return (item !== null && typeof item === 'object' && Array.isArray(item) === false);
|
|
3
|
+
}
|
|
4
|
+
export function isString(item) {
|
|
5
|
+
return typeof item === 'string';
|
|
6
|
+
}
|
|
7
|
+
export function isError(item) {
|
|
8
|
+
return item instanceof Error;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=type-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-functions.js","sourceRoot":"./src/","sources":["lang/type-functions.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAO,CACL,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAO,IAAI,YAAY,KAAK,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["validator/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validString = exports.isValidString = exports.betweenValues = exports.isBetweenValues = exports.maxValue = exports.isMaxValue = exports.minValue = exports.isMinValue = exports.number = exports.isNumber = exports.minLength = exports.isMinLength = exports.maxLength = exports.isMaxLength = exports.email = exports.isEmail = exports.match = exports.isMatch = exports.notBlank = exports.isNotBlank = exports.notEmpty = exports.isNotEmpty = exports.notNull = exports.isNotNull = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
1
|
+
import { ValidationError } from '../errors';
|
|
5
2
|
/**
|
|
6
3
|
* Tests if a value is null or undefined.
|
|
7
4
|
*
|
|
8
5
|
* @param o the value to check
|
|
9
6
|
*/
|
|
10
|
-
function isNotNull(o) {
|
|
7
|
+
export function isNotNull(o) {
|
|
11
8
|
return o !== undefined && o !== null;
|
|
12
9
|
}
|
|
13
|
-
exports.isNotNull = isNotNull;
|
|
14
10
|
/**
|
|
15
11
|
* Throws a ValidationError if the value is null or undefined.
|
|
16
12
|
* This function also asserts the value to be NonNullable if the check passes.
|
|
@@ -18,21 +14,19 @@ exports.isNotNull = isNotNull;
|
|
|
18
14
|
* @param name the name of the variable
|
|
19
15
|
* @param o the value to check
|
|
20
16
|
*/
|
|
21
|
-
function notNull(name, o) {
|
|
17
|
+
export function notNull(name, o) {
|
|
22
18
|
if (!isNotNull(o)) {
|
|
23
|
-
throw new
|
|
19
|
+
throw new ValidationError(`${name} may not be null or undefined`);
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
exports.notNull = notNull;
|
|
27
22
|
/**
|
|
28
23
|
* Tests if a value is empty, null, undefined or has a length of 0.
|
|
29
24
|
*
|
|
30
25
|
* @param o the value to check
|
|
31
26
|
*/
|
|
32
|
-
function isNotEmpty(o) {
|
|
27
|
+
export function isNotEmpty(o) {
|
|
33
28
|
return !(o === undefined || o === null || o.toString().length === 0);
|
|
34
29
|
}
|
|
35
|
-
exports.isNotEmpty = isNotEmpty;
|
|
36
30
|
/**
|
|
37
31
|
* Throws a ValidationError if the value is null, undefined or the length is 0.
|
|
38
32
|
* This function also asserts the value to be NonNullable if the check passes.
|
|
@@ -40,21 +34,19 @@ exports.isNotEmpty = isNotEmpty;
|
|
|
40
34
|
* @param name the name of the variable
|
|
41
35
|
* @param o the value to check
|
|
42
36
|
*/
|
|
43
|
-
function notEmpty(name, o) {
|
|
37
|
+
export function notEmpty(name, o) {
|
|
44
38
|
if (!isNotEmpty(o)) {
|
|
45
|
-
throw new
|
|
39
|
+
throw new ValidationError(`${name} may not be empty`);
|
|
46
40
|
}
|
|
47
41
|
}
|
|
48
|
-
exports.notEmpty = notEmpty;
|
|
49
42
|
/**
|
|
50
43
|
* Tests if a value is null, undefined, has a length of 0 or contains only whitespace.
|
|
51
44
|
*
|
|
52
45
|
* @param o the value to check
|
|
53
46
|
*/
|
|
54
|
-
function isNotBlank(o) {
|
|
47
|
+
export function isNotBlank(o) {
|
|
55
48
|
return !(o === undefined || o === null || o.toString().trim().length === 0);
|
|
56
49
|
}
|
|
57
|
-
exports.isNotBlank = isNotBlank;
|
|
58
50
|
/**
|
|
59
51
|
* Throws a ValidationError if the value is null, undefined, has a length of 0 or contains only whitespace.
|
|
60
52
|
* This function also asserts the value to be NonNullable if the check passes.
|
|
@@ -62,12 +54,11 @@ exports.isNotBlank = isNotBlank;
|
|
|
62
54
|
* @param name the name of the variable
|
|
63
55
|
* @param o the value to check
|
|
64
56
|
*/
|
|
65
|
-
function notBlank(name, o) {
|
|
57
|
+
export function notBlank(name, o) {
|
|
66
58
|
if (!isNotBlank(o)) {
|
|
67
|
-
throw new
|
|
59
|
+
throw new ValidationError(`${name} may not be blank`);
|
|
68
60
|
}
|
|
69
61
|
}
|
|
70
|
-
exports.notBlank = notBlank;
|
|
71
62
|
/**
|
|
72
63
|
* Tests if a value does not match the regular expression provided.
|
|
73
64
|
* Undefined and null values are skipped and not tested.
|
|
@@ -75,13 +66,12 @@ exports.notBlank = notBlank;
|
|
|
75
66
|
* @param regex the regular expression to test with
|
|
76
67
|
* @param o the value to check
|
|
77
68
|
*/
|
|
78
|
-
function isMatch(regex, o) {
|
|
69
|
+
export function isMatch(regex, o) {
|
|
79
70
|
if (o === undefined || o === null) {
|
|
80
71
|
return true;
|
|
81
72
|
}
|
|
82
73
|
return o.match(regex) !== null;
|
|
83
74
|
}
|
|
84
|
-
exports.isMatch = isMatch;
|
|
85
75
|
/**
|
|
86
76
|
* Throws a ValidationError if the value matches the regular expression provided.
|
|
87
77
|
* Undefined and null values are skipped and not validated.
|
|
@@ -90,23 +80,21 @@ exports.isMatch = isMatch;
|
|
|
90
80
|
* @param regex the regular expression to validate with
|
|
91
81
|
* @param o the value to check
|
|
92
82
|
*/
|
|
93
|
-
function match(name, regex, o) {
|
|
83
|
+
export function match(name, regex, o) {
|
|
94
84
|
if (!isMatch(regex, o)) {
|
|
95
|
-
throw new
|
|
85
|
+
throw new ValidationError(`${name} must match ${regex}`);
|
|
96
86
|
}
|
|
97
87
|
}
|
|
98
|
-
exports.match = match;
|
|
99
88
|
/**
|
|
100
89
|
* Tests if a value is a valid email address.
|
|
101
90
|
* Undefined and null values are skipped and not validated.
|
|
102
91
|
*
|
|
103
92
|
* @param o the value to check
|
|
104
93
|
*/
|
|
105
|
-
function isEmail(o) {
|
|
94
|
+
export function isEmail(o) {
|
|
106
95
|
const expression = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
|
|
107
96
|
return !(o !== undefined && o !== null && !expression.test(o));
|
|
108
97
|
}
|
|
109
|
-
exports.isEmail = isEmail;
|
|
110
98
|
/**
|
|
111
99
|
* Throws a ValidationError if the value provided is not an email.
|
|
112
100
|
* Undefined and null values are skipped and not validated.
|
|
@@ -114,12 +102,11 @@ exports.isEmail = isEmail;
|
|
|
114
102
|
* @param name the name of the variable
|
|
115
103
|
* @param o the value to check
|
|
116
104
|
*/
|
|
117
|
-
function email(name, o) {
|
|
105
|
+
export function email(name, o) {
|
|
118
106
|
if (!isEmail(o)) {
|
|
119
|
-
throw new
|
|
107
|
+
throw new ValidationError(`${name} is not a valid email address`);
|
|
120
108
|
}
|
|
121
109
|
}
|
|
122
|
-
exports.email = email;
|
|
123
110
|
/**
|
|
124
111
|
* Tests if a value has a length that is less than the provided length.
|
|
125
112
|
* Undefined and null values are skipped and not validated.
|
|
@@ -127,10 +114,9 @@ exports.email = email;
|
|
|
127
114
|
* @param length the maximum length of the variable
|
|
128
115
|
* @param o the value to check
|
|
129
116
|
*/
|
|
130
|
-
function isMaxLength(length, o) {
|
|
117
|
+
export function isMaxLength(length, o) {
|
|
131
118
|
return !(o !== undefined && o !== null && o.length > length);
|
|
132
119
|
}
|
|
133
|
-
exports.isMaxLength = isMaxLength;
|
|
134
120
|
/**
|
|
135
121
|
* Throws a ValidationError if the value provided has a length that exceeds the provided length.
|
|
136
122
|
* Undefined and null values are skipped and not validated.
|
|
@@ -139,12 +125,11 @@ exports.isMaxLength = isMaxLength;
|
|
|
139
125
|
* @param length the maximum length of the variable
|
|
140
126
|
* @param o the value to check
|
|
141
127
|
*/
|
|
142
|
-
function maxLength(name, length, o) {
|
|
128
|
+
export function maxLength(name, length, o) {
|
|
143
129
|
if (!isMaxLength(length, o)) {
|
|
144
|
-
throw new
|
|
130
|
+
throw new ValidationError(`length of ${name} may not exceed ${length}`);
|
|
145
131
|
}
|
|
146
132
|
}
|
|
147
|
-
exports.maxLength = maxLength;
|
|
148
133
|
/**
|
|
149
134
|
* Tests if a value has a length that is greater than the provided length.
|
|
150
135
|
* Undefined and null values are skipped and not validated.
|
|
@@ -152,10 +137,9 @@ exports.maxLength = maxLength;
|
|
|
152
137
|
* @param length the minimum length of the variable
|
|
153
138
|
* @param o the value to check
|
|
154
139
|
*/
|
|
155
|
-
function isMinLength(length, o) {
|
|
140
|
+
export function isMinLength(length, o) {
|
|
156
141
|
return !(o !== undefined && o !== null && o.length < length);
|
|
157
142
|
}
|
|
158
|
-
exports.isMinLength = isMinLength;
|
|
159
143
|
/**
|
|
160
144
|
* Throws a ValidationError if the value provided has a length that is less than the provided length.
|
|
161
145
|
* Undefined and null values are skipped and not validated.
|
|
@@ -164,22 +148,20 @@ exports.isMinLength = isMinLength;
|
|
|
164
148
|
* @param length the minimum length of the variable
|
|
165
149
|
* @param o the value to check
|
|
166
150
|
*/
|
|
167
|
-
function minLength(name, length, o) {
|
|
151
|
+
export function minLength(name, length, o) {
|
|
168
152
|
if (!isMinLength(length, o)) {
|
|
169
|
-
throw new
|
|
153
|
+
throw new ValidationError(`length of ${name} may not be less than ${length}`);
|
|
170
154
|
}
|
|
171
155
|
}
|
|
172
|
-
exports.minLength = minLength;
|
|
173
156
|
/**
|
|
174
157
|
* Tests if a value provided is a number.
|
|
175
158
|
* Undefined and null values are skipped and not validated.
|
|
176
159
|
*
|
|
177
160
|
* @param o the value to check
|
|
178
161
|
*/
|
|
179
|
-
function isNumber(o) {
|
|
162
|
+
export function isNumber(o) {
|
|
180
163
|
return o === undefined || o === null || !isNaN(+o);
|
|
181
164
|
}
|
|
182
|
-
exports.isNumber = isNumber;
|
|
183
165
|
/**
|
|
184
166
|
* Throws a ValidationError if the value provided is not a number.
|
|
185
167
|
* Undefined and null values are skipped and not validated.
|
|
@@ -187,12 +169,11 @@ exports.isNumber = isNumber;
|
|
|
187
169
|
* @param name the name of the variable
|
|
188
170
|
* @param o the value to check
|
|
189
171
|
*/
|
|
190
|
-
function number(name, o) {
|
|
172
|
+
export function number(name, o) {
|
|
191
173
|
if (!isNumber(o)) {
|
|
192
|
-
throw new
|
|
174
|
+
throw new ValidationError(`${name} is not a number`);
|
|
193
175
|
}
|
|
194
176
|
}
|
|
195
|
-
exports.number = number;
|
|
196
177
|
/**
|
|
197
178
|
* Tests if a value is less than the provided minimum value.
|
|
198
179
|
* Undefined and null values are skipped and not validated.
|
|
@@ -200,10 +181,9 @@ exports.number = number;
|
|
|
200
181
|
* @param minValue the minimum value allowed
|
|
201
182
|
* @param o the value to check
|
|
202
183
|
*/
|
|
203
|
-
function isMinValue(minValue, o) {
|
|
184
|
+
export function isMinValue(minValue, o) {
|
|
204
185
|
return o === undefined || o === null || +o >= minValue;
|
|
205
186
|
}
|
|
206
|
-
exports.isMinValue = isMinValue;
|
|
207
187
|
/**
|
|
208
188
|
* Throws a ValidationError if the value is less than the provided minimum value.
|
|
209
189
|
* Undefined and null values are skipped and not validated.
|
|
@@ -212,12 +192,11 @@ exports.isMinValue = isMinValue;
|
|
|
212
192
|
* @param minValue the minimum value allowed
|
|
213
193
|
* @param o the value to check
|
|
214
194
|
*/
|
|
215
|
-
function minValue(name, minValue, o) {
|
|
195
|
+
export function minValue(name, minValue, o) {
|
|
216
196
|
if (!isMinValue(minValue, o)) {
|
|
217
|
-
throw new
|
|
197
|
+
throw new ValidationError(`${name} may not be less than ${minValue}`);
|
|
218
198
|
}
|
|
219
199
|
}
|
|
220
|
-
exports.minValue = minValue;
|
|
221
200
|
/**
|
|
222
201
|
* Tests if a value is more than the provided maximum value.
|
|
223
202
|
* Undefined and null values are skipped and not validated.
|
|
@@ -225,10 +204,9 @@ exports.minValue = minValue;
|
|
|
225
204
|
* @param maxValue the maximum value allowed
|
|
226
205
|
* @param o the value to check
|
|
227
206
|
*/
|
|
228
|
-
function isMaxValue(maxValue, o) {
|
|
207
|
+
export function isMaxValue(maxValue, o) {
|
|
229
208
|
return !(o !== undefined && o !== null && +o > maxValue);
|
|
230
209
|
}
|
|
231
|
-
exports.isMaxValue = isMaxValue;
|
|
232
210
|
/**
|
|
233
211
|
* Throws a ValidationError if the value is more than the provided maximum value.
|
|
234
212
|
* Undefined and null values are skipped and not validated.
|
|
@@ -237,12 +215,11 @@ exports.isMaxValue = isMaxValue;
|
|
|
237
215
|
* @param maxValue the maximum value allowed
|
|
238
216
|
* @param o the value to check
|
|
239
217
|
*/
|
|
240
|
-
function maxValue(name, maxValue, o) {
|
|
218
|
+
export function maxValue(name, maxValue, o) {
|
|
241
219
|
if (!isMaxValue(maxValue, o)) {
|
|
242
|
-
throw new
|
|
220
|
+
throw new ValidationError(`${name} may not be greater than ${maxValue}`);
|
|
243
221
|
}
|
|
244
222
|
}
|
|
245
|
-
exports.maxValue = maxValue;
|
|
246
223
|
/**
|
|
247
224
|
* Tests if the value is between the provided minimum and maximum values inclusive.
|
|
248
225
|
* Undefined and null values are skipped and not validated.
|
|
@@ -251,10 +228,9 @@ exports.maxValue = maxValue;
|
|
|
251
228
|
* @param maxValue the maximum value allowed
|
|
252
229
|
* @param o the value to check
|
|
253
230
|
*/
|
|
254
|
-
function isBetweenValues(minValue, maxValue, o) {
|
|
231
|
+
export function isBetweenValues(minValue, maxValue, o) {
|
|
255
232
|
return !(o !== undefined && o !== null && (+o < minValue || +o > maxValue));
|
|
256
233
|
}
|
|
257
|
-
exports.isBetweenValues = isBetweenValues;
|
|
258
234
|
/**
|
|
259
235
|
* Throws a ValidationError if the value is not between the provided minimum and maximum values inclusive.
|
|
260
236
|
* Undefined and null values are skipped and not validated.
|
|
@@ -264,14 +240,13 @@ exports.isBetweenValues = isBetweenValues;
|
|
|
264
240
|
* @param maxValue the maximum value allowed
|
|
265
241
|
* @param o the value to check
|
|
266
242
|
*/
|
|
267
|
-
function betweenValues(name, minValue, maxValue, o) {
|
|
243
|
+
export function betweenValues(name, minValue, maxValue, o) {
|
|
268
244
|
if (!isBetweenValues(minValue, maxValue, o)) {
|
|
269
|
-
throw new
|
|
245
|
+
throw new ValidationError(`${name} must be between ${minValue} and ${maxValue}`);
|
|
270
246
|
}
|
|
271
247
|
}
|
|
272
|
-
exports.betweenValues = betweenValues;
|
|
273
248
|
const isString = (value) => typeof value === 'string';
|
|
274
|
-
function isValidString(options, value) {
|
|
249
|
+
export function isValidString(options, value) {
|
|
275
250
|
if (options.required) {
|
|
276
251
|
if (!isNotNull(value)) {
|
|
277
252
|
return false;
|
|
@@ -306,8 +281,7 @@ function isValidString(options, value) {
|
|
|
306
281
|
}
|
|
307
282
|
return true;
|
|
308
283
|
}
|
|
309
|
-
|
|
310
|
-
function validString(name, options, value) {
|
|
284
|
+
export function validString(name, options, value) {
|
|
311
285
|
if (options.required) {
|
|
312
286
|
notNull(name, value);
|
|
313
287
|
}
|
|
@@ -315,7 +289,7 @@ function validString(name, options, value) {
|
|
|
315
289
|
return;
|
|
316
290
|
}
|
|
317
291
|
if (!isString(value)) {
|
|
318
|
-
throw new
|
|
292
|
+
throw new ValidationError(`${name} must be a string`);
|
|
319
293
|
}
|
|
320
294
|
options.minLength && minLength(name, options.minLength, value);
|
|
321
295
|
options.maxLength && maxLength(name, options.maxLength, value);
|
|
@@ -325,5 +299,4 @@ function validString(name, options, value) {
|
|
|
325
299
|
options.email && email(name, value);
|
|
326
300
|
options.number && number(name, value);
|
|
327
301
|
}
|
|
328
|
-
exports.validString = validString;
|
|
329
302
|
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"./src/","sources":["validator/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,CAAW;IACnC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MA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EAAE,KAAK,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nr1e/commons",
|
|
3
3
|
"description": "Provides common patterns for validation",
|
|
4
|
-
"version": "0.0.3-alpha.
|
|
4
|
+
"version": "0.0.3-alpha.9",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"types": "index.d.ts",
|
|
7
8
|
"author": "NR1E, Inc.",
|
|
@@ -33,13 +34,12 @@
|
|
|
33
34
|
"typescript": "~5.1.6"
|
|
34
35
|
},
|
|
35
36
|
"exports": {
|
|
36
|
-
"
|
|
37
|
-
"./
|
|
38
|
-
"./
|
|
39
|
-
"./
|
|
40
|
-
"./lang": "./lang/index.js",
|
|
37
|
+
"./bitsnbytes": "./dist/bitsnbytes/index.js",
|
|
38
|
+
"./errors": "./dist/errors/index.js",
|
|
39
|
+
"./http": "./dist/http/index.js",
|
|
40
|
+
"./lang": "./dist/lang/index.js",
|
|
41
41
|
"./package.json": "./package.json",
|
|
42
|
-
"./validator": "./validator/index.js"
|
|
42
|
+
"./validator": "./dist/validator/index.js"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|
package/.prettierrc.js
DELETED
package/bitsnbytes/b64.js.map
DELETED
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C,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,GAAW,EAAE,IAAoB;IACvD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAFD,0BAEC"}
|
package/bitsnbytes/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./b64"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/bitsnbytes/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
package/errors/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["errors.ts"],"names":[],"mappings":";;;AAAA,kCAAuC;AACvC,kCAA0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AQ,IAAI,EAAE;QACZ,KAAK,qBAAc,CAAC,SAAS;YAC3B,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,KAAK,qBAAc,CAAC,SAAS;YAC3B,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,KAAK,qBAAc,CAAC,WAAW;YAC7B,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QACtC,KAAK,qBAAc,CAAC,qBAAqB;YACvC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C,KAAK,qBAAc,CAAC,QAAQ;YAC1B,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,KAAK,qBAAc,CAAC,sBAAsB;YACxC,OAAO,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAChD,KAAK,qBAAc,CAAC,eAAe;YACjC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C;YACE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC;AAtBD,0BAsBC"}
|
package/errors/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./errors"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/errors/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
package/http/http-method.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-method.js","sourceRoot":"","sources":["http-method.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;AACrB,CAAC,EARW,UAAU,0BAAV,UAAU,QAQrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-status-code.js","sourceRoot":"","sources":["http-status-code.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAyCX;AAzCD,WAAY,cAAc;IACxB,6DAAc,CAAA;IACd,mFAAyB,CAAA;IACzB,iDAAQ,CAAA;IACR,2DAAa,CAAA;IACb,6DAAc,CAAA;IACd,uGAAmC,CAAA;IACnC,iEAAgB,CAAA;IAChB,uEAAmB,CAAA;IACnB,2EAAqB,CAAA;IACrB,6EAAsB,CAAA;IACtB,iFAAwB,CAAA;IACxB,uDAAW,CAAA;IACX,+DAAe,CAAA;IACf,qEAAkB,CAAA;IAClB,+DAAe,CAAA;IACf,iFAAwB,CAAA;IACxB,mEAAiB,CAAA;IACjB,qEAAkB,CAAA;IAClB,6EAAsB,CAAA;IACtB,+DAAe,CAAA;IACf,+DAAe,CAAA;IACf,iFAAwB,CAAA;IACxB,yEAAoB,CAAA;IACpB,uGAAmC,CAAA;IACnC,2EAAqB,CAAA;IACrB,6DAAc,CAAA;IACd,qDAAU,CAAA;IACV,2EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,6FAA8B,CAAA;IAC9B,qFAA0B,CAAA;IAC1B,yFAA4B,CAAA;IAC5B,uFAA2B,CAAA;IAC3B,iFAAwB,CAAA;IACxB,uFAA2B,CAAA;IAC3B,2EAAqB,CAAA;IACrB,mEAAiB,CAAA;IACjB,mFAAyB,CAAA;IACzB,2EAAqB,CAAA;IACrB,iGAAgC,CAAA;AAClC,CAAC,EAzCW,cAAc,8BAAd,cAAc,QAyCzB"}
|
package/http/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./http-status-code"), exports);
|
|
18
|
-
__exportStar(require("./http-method"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/http/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gDAA8B"}
|
package/index.d.ts
DELETED
package/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bitsnbytes = exports.lang = exports.http = exports.errors = exports.validator = void 0;
|
|
4
|
-
exports.validator = require("./validator");
|
|
5
|
-
exports.errors = require("./errors");
|
|
6
|
-
exports.http = require("./http");
|
|
7
|
-
exports.lang = require("./lang");
|
|
8
|
-
exports.bitsnbytes = require("./bitsnbytes");
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AACzC,qCAAmC;AACnC,iCAA+B;AAC/B,iCAA+B;AAC/B,6CAA2C"}
|
package/jest.config.js
DELETED
package/lang/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./type-functions"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/lang/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
package/lang/type-functions.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isError = exports.isString = exports.isObject = void 0;
|
|
4
|
-
function isObject(item) {
|
|
5
|
-
return (item !== null && typeof item === 'object' && Array.isArray(item) === false);
|
|
6
|
-
}
|
|
7
|
-
exports.isObject = isObject;
|
|
8
|
-
function isString(item) {
|
|
9
|
-
return typeof item === 'string';
|
|
10
|
-
}
|
|
11
|
-
exports.isString = isString;
|
|
12
|
-
function isError(item) {
|
|
13
|
-
return item instanceof Error;
|
|
14
|
-
}
|
|
15
|
-
exports.isError = isError;
|
|
16
|
-
//# sourceMappingURL=type-functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-functions.js","sourceRoot":"","sources":["type-functions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,CACL,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CAC3E,CAAC;AACJ,CAAC;AAJD,4BAIC;AAED,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAFD,4BAEC;AAED,SAAgB,OAAO,CAAC,IAAa;IACnC,OAAO,IAAI,YAAY,KAAK,CAAC;AAC/B,CAAC;AAFD,0BAEC"}
|
package/validator/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./validators"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/validator/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["validators.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAE1C;;;;GAIG;AACH,SAAgB,SAAS,CAAC,CAAW;IACnC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAFD,8BAEC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CACrB,IAAY,EACZ,CAAW;IAEX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;QACjB,MAAM,IAAI,wBAAe,CAAC,GAAG,IAAI,+BAA+B,CAAC,CAAC;KACnE;AACH,CAAC;AAPD,0BAOC;AAED;;;;GAIG;AACH,SAAgB,UA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,CAAC;IAC/D,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AApBD,kCAoBC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|