alado 1.1.1 → 1.2.1
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formDataRegExp = exports.spaceRegExp = exports.multiSlashRegExp = exports.trimRouteRegexp = exports.startRouteRegexp = exports.outputPropertyRegexp = exports.inputPropertyRegexp = void 0;
|
|
3
|
+
exports.deprecatedJsonPropertiesRegExp = exports.formDataRegExp = exports.spaceRegExp = exports.multiSlashRegExp = exports.trimRouteRegexp = exports.startRouteRegexp = exports.outputPropertyRegexp = exports.inputPropertyRegexp = void 0;
|
|
4
4
|
exports.inputPropertyRegexp = /^(headers|body|query|path)(\.\w+)$/;
|
|
5
5
|
exports.outputPropertyRegexp = /^auth(\.\w+)?$/;
|
|
6
6
|
exports.startRouteRegexp = /^\//;
|
|
@@ -13,4 +13,5 @@ exports.formDataRegExp = {
|
|
|
13
13
|
filename: /filename="(.*?)"/,
|
|
14
14
|
mimetype: /Content-Type:(.*?)\r\n/
|
|
15
15
|
};
|
|
16
|
+
exports.deprecatedJsonPropertiesRegExp = /\.?(__(proto|defineGetter|defineSetter)__|(prototype|constructor))/;
|
|
16
17
|
//# sourceMappingURL=reg-exp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reg-exp.js","sourceRoot":"","sources":["../../src/constants/reg-exp.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,oCAAoC,CAAC;AAC3D,QAAA,oBAAoB,GAAG,gBAAgB,CAAC;AAExC,QAAA,gBAAgB,GAAW,KAAK,CAAC;AACjC,QAAA,eAAe,GAAW,KAAK,CAAC;AAChC,QAAA,gBAAgB,GAAW,MAAM,CAAC;AAElC,QAAA,WAAW,GAAW,WAAW,CAAC;AAElC,QAAA,cAAc,GAA2B;IACpD,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,wBAAwB;CACnC,CAAA"}
|
|
1
|
+
{"version":3,"file":"reg-exp.js","sourceRoot":"","sources":["../../src/constants/reg-exp.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,oCAAoC,CAAC;AAC3D,QAAA,oBAAoB,GAAG,gBAAgB,CAAC;AAExC,QAAA,gBAAgB,GAAW,KAAK,CAAC;AACjC,QAAA,eAAe,GAAW,KAAK,CAAC;AAChC,QAAA,gBAAgB,GAAW,MAAM,CAAC;AAElC,QAAA,WAAW,GAAW,WAAW,CAAC;AAElC,QAAA,cAAc,GAA2B;IACpD,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,wBAAwB;CACnC,CAAA;AAEY,QAAA,8BAA8B,GAAG,oEAAoE,CAAC"}
|
|
@@ -10,7 +10,7 @@ async function bodyParser(req) {
|
|
|
10
10
|
files: {}
|
|
11
11
|
};
|
|
12
12
|
let body = '';
|
|
13
|
-
if (contentType
|
|
13
|
+
if (contentType?.match(_const_1.ContentType.FORM_DATA)) {
|
|
14
14
|
req.setEncoding('binary');
|
|
15
15
|
const matchingArray = /boundary=(.+)$/.exec(req.headers['content-type']);
|
|
16
16
|
const boundary = matchingArray && matchingArray[1];
|
|
@@ -73,7 +73,11 @@ async function bodyParser(req) {
|
|
|
73
73
|
req.on('end', () => {
|
|
74
74
|
if (contentType === _const_1.ContentType.JSON) {
|
|
75
75
|
try {
|
|
76
|
-
result.body = JSON.parse(body)
|
|
76
|
+
result.body = JSON.parse(body, function (key, value) {
|
|
77
|
+
if (!_const_1.deprecatedJsonPropertiesRegExp.test(key)) {
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
77
81
|
resolve();
|
|
78
82
|
}
|
|
79
83
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-parser.js","sourceRoot":"","sources":["../../../src/helpers/parser/body-parser.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"body-parser.js","sourceRoot":"","sources":["../../../src/helpers/parser/body-parser.ts"],"names":[],"mappings":";;;AACA,mCAKgB;AAChB,mCAAkC;AAIlC,KAAK,UAAU,UAAU,CAAC,GAAoB;IAC5C,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,MAAM,GAAQ;QAClB,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;KACV,CAAA;IACD,IAAI,IAAI,GAAW,EAAE,CAAC;IACtB,IAAI,WAAW,EAAE,KAAK,CAAC,oBAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9C,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC1B,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAY,aAAa,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE;gBAC5B,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,MAAM,QAAQ,GAAQ;oBACpB,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,EAAE;iBACX,CAAA;gBACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAClC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;oBACxB,MAAM,OAAO,GAAQ,EAAE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AAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAC,CAAC,CAAA;oBACrD,CAAC;gBACH,CAAC;qBAAM,IAAI,WAAW,KAAK,oBAAW,CAAC,qBAAqB,EAAE,CAAC;oBAC7D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;wBACvC,MAAM,CAAE,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBACtC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;oBAC3B,CAAC,CAAC,CAAC;oBACH,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;oBACnB,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AA5FD,gCA4FC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alado",
|
|
3
3
|
"description": "Extremely fast, lightweight, robust framework for HTTP applications written in Node.js",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"author": "Pavlo Lazunko",
|
|
@@ -32,9 +32,6 @@
|
|
|
32
32
|
"pre-commit": "npm run eslint"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=20.10.0"
|
|
37
|
-
},
|
|
38
35
|
"repository": {
|
|
39
36
|
"type": "git",
|
|
40
37
|
"url": "git@github.com:databikers/alado.git"
|