@tsed/core 6.90.0 → 6.93.0
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/cjs/utils/http/getHostInfoFromPort.d.ts +6 -0
- package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
- package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
- package/lib/cjs/utils/index.d.ts +1 -0
- package/lib/cjs/utils/index.js +1 -0
- package/lib/cjs/utils/index.js.map +1 -1
- package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
- package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
- package/lib/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHostInfoFromPort = void 0;
|
|
4
|
+
function getHostInfoFromPort(protocol, addressPort) {
|
|
5
|
+
let address = "0.0.0.0";
|
|
6
|
+
let port = addressPort;
|
|
7
|
+
if (typeof addressPort === "string" && addressPort.indexOf(":") > -1) {
|
|
8
|
+
[address, port] = addressPort.split(":");
|
|
9
|
+
port = +port;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
protocol,
|
|
13
|
+
address,
|
|
14
|
+
port: port,
|
|
15
|
+
toString() {
|
|
16
|
+
return [`${this.protocol}://${this.address}`, typeof this.port === "number" && this.port].filter(Boolean).join(":");
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.getHostInfoFromPort = getHostInfoFromPort;
|
|
21
|
+
//# sourceMappingURL=getHostInfoFromPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHostInfoFromPort.js","sourceRoot":"","sources":["../../../../src/utils/http/getHostInfoFromPort.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,WAAgB;IACpE,IAAI,OAAO,GAAG,SAAS,CAAC;IACxB,IAAI,IAAI,GAAG,WAAW,CAAC;IAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QACpE,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,IAAI,CAAC;KACd;IAED,OAAO;QACL,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,IAAc;QACpB,QAAQ;YACN,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtH,CAAC;KACF,CAAC;AACJ,CAAC;AAjBD,kDAiBC","sourcesContent":["export function getHostInfoFromPort(protocol: string, addressPort: any) {\n let address = \"0.0.0.0\";\n let port = addressPort;\n\n if (typeof addressPort === \"string\" && addressPort.indexOf(\":\") > -1) {\n [address, port] = addressPort.split(\":\");\n port = +port;\n }\n\n return {\n protocol,\n address,\n port: port as number,\n toString() {\n return [`${this.protocol}://${this.address}`, typeof this.port === \"number\" && this.port].filter(Boolean).join(\":\");\n }\n };\n}\n"]}
|
package/lib/cjs/utils/index.d.ts
CHANGED
package/lib/cjs/utils/index.js
CHANGED
|
@@ -15,4 +15,5 @@ const tslib_1 = require("tslib");
|
|
|
15
15
|
(0, tslib_1.__exportStar)(require("./decorators/useMethodDecorators"), exports);
|
|
16
16
|
// objects
|
|
17
17
|
(0, tslib_1.__exportStar)(require("./objects"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./http/getHostInfoFromPort"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,iEAAkC;AAClC,sDAAuB;AACvB,uEAAwC;AAExC,UAAU;AACV,8EAA+C;AAC/C,0EAA2C;AAC3C,4EAA6C;AAC7C,sEAAuC;AACvC,kFAAmD;AACnD,0EAA2C;AAC3C,gFAAiD;AAEjD,UAAU;AACV,yDAA0B","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,iEAAkC;AAClC,sDAAuB;AACvB,uEAAwC;AAExC,UAAU;AACV,8EAA+C;AAC/C,0EAA2C;AAC3C,4EAA6C;AAC7C,sEAAuC;AACvC,kFAAmD;AACnD,0EAA2C;AAC3C,gFAAiD;AAEjD,UAAU;AACV,yDAA0B;AAC1B,0EAA2C","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\nexport * from \"./http/getHostInfoFromPort\";\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function getHostInfoFromPort(protocol, addressPort) {
|
|
2
|
+
let address = "0.0.0.0";
|
|
3
|
+
let port = addressPort;
|
|
4
|
+
if (typeof addressPort === "string" && addressPort.indexOf(":") > -1) {
|
|
5
|
+
[address, port] = addressPort.split(":");
|
|
6
|
+
port = +port;
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
protocol,
|
|
10
|
+
address,
|
|
11
|
+
port: port,
|
|
12
|
+
toString() {
|
|
13
|
+
return [`${this.protocol}://${this.address}`, typeof this.port === "number" && this.port].filter(Boolean).join(":");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=getHostInfoFromPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHostInfoFromPort.js","sourceRoot":"","sources":["../../../../src/utils/http/getHostInfoFromPort.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,WAAgB;IACpE,IAAI,OAAO,GAAG,SAAS,CAAC;IACxB,IAAI,IAAI,GAAG,WAAW,CAAC;IAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QACpE,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,IAAI,CAAC;KACd;IAED,OAAO;QACL,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,IAAc;QACpB,QAAQ;YACN,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["export function getHostInfoFromPort(protocol: string, addressPort: any) {\n let address = \"0.0.0.0\";\n let port = addressPort;\n\n if (typeof addressPort === \"string\" && addressPort.indexOf(\":\") > -1) {\n [address, port] = addressPort.split(\":\");\n port = +port;\n }\n\n return {\n protocol,\n address,\n port: port as number,\n toString() {\n return [`${this.protocol}://${this.address}`, typeof this.port === \"number\" && this.port].filter(Boolean).join(\":\");\n }\n };\n}\n"]}
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AAExC,UAAU;AACV,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AAEjD,UAAU;AACV,cAAc,WAAW,CAAC","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AAExC,UAAU;AACV,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AAEjD,UAAU;AACV,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\nexport * from \"./http/getHostInfoFromPort\";\n"]}
|