@yolo-croket-dev/core 1.9.7-slowquery.14 → 1.9.7-slowquery.15

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/util.d.ts +2 -0
  3. package/util.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.9.7-slowquery.14",
3
+ "version": "1.9.7-slowquery.15",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
package/util.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export declare function generateRandom(length: number, charset?: string): string;
2
+ /** host에서 port를 추출합니다. */
3
+ export declare function getPortFromHost(host: string): number | undefined;
package/util.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateRandom = void 0;
3
+ exports.getPortFromHost = exports.generateRandom = void 0;
4
4
  const randomstring_1 = require("randomstring");
5
5
  function generateRandom(length, charset) {
6
6
  return (0, randomstring_1.generate)({
@@ -9,3 +9,9 @@ function generateRandom(length, charset) {
9
9
  });
10
10
  }
11
11
  exports.generateRandom = generateRandom;
12
+ /** host에서 port를 추출합니다. */
13
+ function getPortFromHost(host) {
14
+ const port = host.split(':')[1];
15
+ return port ? parseInt(port, 10) : undefined;
16
+ }
17
+ exports.getPortFromHost = getPortFromHost;