xjs-common 10.1.0 → 10.1.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,7 @@
1
1
  import { TimeUnit } from "../const/time-unit";
2
2
  export declare namespace UString {
3
3
  function eq(s1: string, s2: string): boolean;
4
+ function repeat(token: string, mlt: number): string;
4
5
  /**
5
6
  * generate date time number as fixed length (depends on `unit`) string without separator charactor.
6
7
  * For example, `2025-06-08T10:15:06.366Z` is to be `20250608101506366`.
@@ -11,7 +12,6 @@ export declare namespace UString {
11
12
  date?: Date;
12
13
  unit?: TimeUnit;
13
14
  }): string;
14
- function trimProps(obj: any): void;
15
15
  function generateRandomString(len: number): string;
16
16
  function idx2az(idx: number): string;
17
17
  function az2idx(az: string): number;
@@ -12,6 +12,10 @@ var UString;
12
12
  return !u_type_1.UType.isString(s1) || !u_type_1.UType.isString(s2) ? s1 === s2 : s1.trim() === s2.trim();
13
13
  }
14
14
  UString.eq = eq;
15
+ function repeat(token, mlt) {
16
+ return (0, u_1.int2array)(mlt).map(_ => token).join("");
17
+ }
18
+ UString.repeat = repeat;
15
19
  /**
16
20
  * generate date time number as fixed length (depends on `unit`) string without separator charactor.
17
21
  * For example, `2025-06-08T10:15:06.366Z` is to be `20250608101506366`.
@@ -25,12 +29,6 @@ var UString;
25
29
  return t.substring(0, 14 - (6 - (op?.unit ?? time_unit_1.TimeUnit.Sec)) * 2);
26
30
  }
27
31
  UString.simpleTime = simpleTime;
28
- function trimProps(obj) {
29
- Object.keys(obj)
30
- .filter(k => typeof obj[k] === "string")
31
- .forEach(k => obj[k] = obj[k]?.trim());
32
- }
33
- UString.trimProps = trimProps;
34
32
  function generateRandomString(len) {
35
33
  return (0, u_1.int2array)(len).map(_ => {
36
34
  let rnd = Math.floor(62 * Math.random());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xjs-common",
3
- "version": "10.1.0",
3
+ "version": "10.1.1",
4
4
  "description": "library modules for typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",