xjs-common 8.0.1 → 8.0.3

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/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  [![CI](https://github.com/begyyal/xjs_commons/actions/workflows/test.yml/badge.svg)](https://github.com/begyyal/xjs_commons/actions/workflows/test.yml)
2
2
 
3
- Available to `npm i xjs-common`.
4
- **NOTE**: The versions <= `v6.2.0` was unpublished. If you has been used these versions, please update to the version >= `v7.0.0`.
5
-
6
3
  # Overview
7
4
  Library modules for nodejs + typescript that bundled general-purpose implementations.
8
5
  This module is very simple, therefore it has no dependencies.
9
6
 
7
+ # Install
8
+ ```
9
+ npm i xjs-common
10
+ ```
11
+ **NOTE**: The versions <= `v6.2.0` was unpublished. If you has been used these versions, please update to the version >= `v7.0.0`.
12
+
10
13
  # Code example (only part)
11
14
  - Miscellaneous utilities.
12
15
  ```ts
@@ -205,7 +208,7 @@ class Cls_B {
205
208
  console.log(UType.validate(Object.assign(new Cls_A(), invalid6))); // [ 'objA.aryB' ]
206
209
  })();
207
210
  ```
208
- ## Error definition
211
+ # Error definition
209
212
  XJS throws error with `code` property which has one of the following numbers.
210
213
  |code|thrown by|
211
214
  |:---|:---|
@@ -214,3 +217,6 @@ XJS throws error with `code` property which has one of the following numbers.
214
217
  |30|`func/u-type` (include `func/decorator/d-type`) |
215
218
  |100|`func/decorator/transaction`|
216
219
  |200|`prcs/http/http-resolver`|
220
+
221
+ # License
222
+ [Apache-License](./LICENSE)
@@ -34,7 +34,7 @@ var UObj;
34
34
  return {};
35
35
  const _keys = keys ?? Object.keys(o[d_type_1.smbl_tm]);
36
36
  Object.keys(o).filter(k => {
37
- if (!keys && o[d_type_1.smbl_tm]?.[k]?.rec)
37
+ if (!keys && o[d_type_1.smbl_tm]?.[k]?.rec && o[k])
38
38
  crop(o[k]);
39
39
  return !!exclusive === _keys.includes(k);
40
40
  }).forEach(k => delete o[k]);
package/dist/func/u.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare function getJSTDate(): Date;
1
+ export declare function getJSTDate(d?: Date): Date;
2
2
  export declare function delay(sec: number): Promise<void>;
3
3
  export declare function int2array(size: number): number[];
4
4
  export declare function array2map<K, T>(array: T[], keyGen: (e: T) => K): Map<K, T[]>;
package/dist/func/u.js CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkPortAvailability = exports.bitor = exports.array2map = exports.int2array = exports.delay = exports.getJSTDate = void 0;
4
4
  const xjs_err_1 = require("../obj/xjs-err");
5
5
  const s_errCode = 10;
6
- function getJSTDate() {
7
- return new Date(Date.now() + 9 * 60 * 60 * 1000);
6
+ function getJSTDate(d) {
7
+ return new Date((d ? d.getTime() : Date.now()) + 9 * 60 * 60 * 1000);
8
8
  }
9
9
  exports.getJSTDate = getJSTDate;
10
10
  function delay(sec) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "xjs-common",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "description": "library modules for nodejs + typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/begyyal/xjs_commons"
8
8
  },
9
9
  "keywords": [
10
- "node",
10
+ "nodejs",
11
11
  "typescript",
12
12
  "utility"
13
13
  ],