@unikue/ts-lang-utils 1.2.4 → 1.2.6
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 +21 -21
- package/README.zh-CN.md +21 -21
- package/README.zh-TW.md +21 -21
- package/dist/cjs/util/DateUtils/formatDateTime.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getEndOfDay.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getEndOfMonth.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getEndOfYear.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getStartOfDay.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getStartOfMonth.d.ts +1 -1
- package/dist/cjs/util/DateUtils/getStartOfYear.d.ts +1 -1
- package/dist/cjs/util/DateUtils/isTomorrow.d.ts +1 -1
- package/dist/cjs/util/DateUtils/isWeekend.d.ts +1 -1
- package/dist/cjs/util/DateUtils/isYesterday.d.ts +1 -1
- package/dist/cjs/util/DurationUtils/formatSeconds.d.ts +1 -0
- package/dist/cjs/util/DurationUtils/formatSeconds.js +44 -0
- package/dist/cjs/util/DurationUtils/index.d.ts +1 -0
- package/dist/cjs/util/DurationUtils/index.js +3 -0
- package/dist/cjs/util/DurationUtils/parseToMonths.js +1 -1
- package/dist/cjs/util/DurationUtils/parseToWeeks.js +1 -1
- package/dist/cjs/util/DurationUtils/parseToYears.js +1 -1
- package/dist/cjs/util/UriUtils/index.d.ts +2 -0
- package/dist/cjs/util/UriUtils/index.js +8 -2
- package/dist/cjs/util/UriUtils/isHttp.d.ts +1 -0
- package/dist/cjs/util/UriUtils/isHttp.js +31 -0
- package/dist/cjs/util/UriUtils/isHttps.d.ts +1 -0
- package/dist/cjs/util/UriUtils/isHttps.js +31 -0
- package/dist/esm/util/DateUtils/formatDateTime.d.ts +1 -1
- package/dist/esm/util/DateUtils/getEndOfDay.d.ts +1 -1
- package/dist/esm/util/DateUtils/getEndOfMonth.d.ts +1 -1
- package/dist/esm/util/DateUtils/getEndOfYear.d.ts +1 -1
- package/dist/esm/util/DateUtils/getStartOfDay.d.ts +1 -1
- package/dist/esm/util/DateUtils/getStartOfMonth.d.ts +1 -1
- package/dist/esm/util/DateUtils/getStartOfYear.d.ts +1 -1
- package/dist/esm/util/DateUtils/isTomorrow.d.ts +1 -1
- package/dist/esm/util/DateUtils/isWeekend.d.ts +1 -1
- package/dist/esm/util/DateUtils/isYesterday.d.ts +1 -1
- package/dist/esm/util/DurationUtils/formatSeconds.d.ts +1 -0
- package/dist/esm/util/DurationUtils/formatSeconds.js +19 -0
- package/dist/esm/util/DurationUtils/index.d.ts +1 -0
- package/dist/esm/util/DurationUtils/index.js +1 -0
- package/dist/esm/util/DurationUtils/parseToMonths.js +1 -1
- package/dist/esm/util/DurationUtils/parseToWeeks.js +1 -1
- package/dist/esm/util/DurationUtils/parseToYears.js +1 -1
- package/dist/esm/util/UriUtils/index.d.ts +2 -0
- package/dist/esm/util/UriUtils/index.js +3 -1
- package/dist/esm/util/UriUtils/isHttp.d.ts +1 -0
- package/dist/esm/util/UriUtils/isHttp.js +3 -0
- package/dist/esm/util/UriUtils/isHttps.d.ts +1 -0
- package/dist/esm/util/UriUtils/isHttps.js +3 -0
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -63,27 +63,27 @@ $ npm install @unikue/ts-lang-utils --save
|
|
|
63
63
|
Then, you may import components as follows:
|
|
64
64
|
|
|
65
65
|
```jsx | pure
|
|
66
|
-
import {ArrayUtils} from '@unikue/ts-lang-utils';
|
|
67
|
-
import {BooleanUtils} from '@unikue/ts-lang-utils';
|
|
68
|
-
import {ColorUtils} from '@unikue/ts-lang-utils';
|
|
69
|
-
import {DateUtils} from '@unikue/ts-lang-utils';
|
|
70
|
-
import {DurationUtils} from '@unikue/ts-lang-utils';
|
|
71
|
-
import {ElementUtils} from '@unikue/ts-lang-utils';
|
|
72
|
-
import {FileUtils} from '@unikue/ts-lang-utils';
|
|
73
|
-
import {ImageUtils} from '@unikue/ts-lang-utils';
|
|
74
|
-
import {JsonUtils} from '@unikue/ts-lang-utils';
|
|
75
|
-
import {MapUtils} from '@unikue/ts-lang-utils';
|
|
76
|
-
import {NanoidUtils} from '@unikue/ts-lang-utils';
|
|
77
|
-
import {NumberUtils} from '@unikue/ts-lang-utils';
|
|
78
|
-
import {ObjectUtils} from '@unikue/ts-lang-utils';
|
|
79
|
-
import {RandomUtils} from '@unikue/ts-lang-utils';
|
|
80
|
-
import {RegexUtils} from '@unikue/ts-lang-utils';
|
|
81
|
-
import {StringUtils} from '@unikue/ts-lang-utils';
|
|
82
|
-
import {ThreadUtils} from '@unikue/ts-lang-utils';
|
|
83
|
-
import {TreeUtils} from '@unikue/ts-lang-utils';
|
|
84
|
-
import {CookieStorage} from '@unikue/ts-lang-utils';
|
|
85
|
-
import {LocalStorage} from '@unikue/ts-lang-utils';
|
|
86
|
-
import {SessionStorage} from '@unikue/ts-lang-utils';
|
|
66
|
+
import { ArrayUtils } from '@unikue/ts-lang-utils';
|
|
67
|
+
import { BooleanUtils } from '@unikue/ts-lang-utils';
|
|
68
|
+
import { ColorUtils } from '@unikue/ts-lang-utils';
|
|
69
|
+
import { DateUtils } from '@unikue/ts-lang-utils';
|
|
70
|
+
import { DurationUtils } from '@unikue/ts-lang-utils';
|
|
71
|
+
import { ElementUtils } from '@unikue/ts-lang-utils';
|
|
72
|
+
import { FileUtils } from '@unikue/ts-lang-utils';
|
|
73
|
+
import { ImageUtils } from '@unikue/ts-lang-utils';
|
|
74
|
+
import { JsonUtils } from '@unikue/ts-lang-utils';
|
|
75
|
+
import { MapUtils } from '@unikue/ts-lang-utils';
|
|
76
|
+
import { NanoidUtils } from '@unikue/ts-lang-utils';
|
|
77
|
+
import { NumberUtils } from '@unikue/ts-lang-utils';
|
|
78
|
+
import { ObjectUtils } from '@unikue/ts-lang-utils';
|
|
79
|
+
import { RandomUtils } from '@unikue/ts-lang-utils';
|
|
80
|
+
import { RegexUtils } from '@unikue/ts-lang-utils';
|
|
81
|
+
import { StringUtils } from '@unikue/ts-lang-utils';
|
|
82
|
+
import { ThreadUtils } from '@unikue/ts-lang-utils';
|
|
83
|
+
import { TreeUtils } from '@unikue/ts-lang-utils';
|
|
84
|
+
import { CookieStorage } from '@unikue/ts-lang-utils';
|
|
85
|
+
import { LocalStorage } from '@unikue/ts-lang-utils';
|
|
86
|
+
import { SessionStorage } from '@unikue/ts-lang-utils';
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Enjoy your coding journey with `ts-lang-utils` ✌️
|
package/README.zh-CN.md
CHANGED
|
@@ -63,27 +63,27 @@ $ npm install @unikue/ts-lang-utils --save
|
|
|
63
63
|
然后,您可以使用以下命令来导入组件:
|
|
64
64
|
|
|
65
65
|
```jsx | pure
|
|
66
|
-
import {ArrayUtils} from '@unikue/ts-lang-utils';
|
|
67
|
-
import {BooleanUtils} from '@unikue/ts-lang-utils';
|
|
68
|
-
import {ColorUtils} from '@unikue/ts-lang-utils';
|
|
69
|
-
import {DateUtils} from '@unikue/ts-lang-utils';
|
|
70
|
-
import {DurationUtils} from '@unikue/ts-lang-utils';
|
|
71
|
-
import {ElementUtils} from '@unikue/ts-lang-utils';
|
|
72
|
-
import {FileUtils} from '@unikue/ts-lang-utils';
|
|
73
|
-
import {ImageUtils} from '@unikue/ts-lang-utils';
|
|
74
|
-
import {JsonUtils} from '@unikue/ts-lang-utils';
|
|
75
|
-
import {MapUtils} from '@unikue/ts-lang-utils';
|
|
76
|
-
import {NanoidUtils} from '@unikue/ts-lang-utils';
|
|
77
|
-
import {NumberUtils} from '@unikue/ts-lang-utils';
|
|
78
|
-
import {ObjectUtils} from '@unikue/ts-lang-utils';
|
|
79
|
-
import {RandomUtils} from '@unikue/ts-lang-utils';
|
|
80
|
-
import {RegexUtils} from '@unikue/ts-lang-utils';
|
|
81
|
-
import {StringUtils} from '@unikue/ts-lang-utils';
|
|
82
|
-
import {ThreadUtils} from '@unikue/ts-lang-utils';
|
|
83
|
-
import {TreeUtils} from '@unikue/ts-lang-utils';
|
|
84
|
-
import {CookieStorage} from '@unikue/ts-lang-utils';
|
|
85
|
-
import {LocalStorage} from '@unikue/ts-lang-utils';
|
|
86
|
-
import {SessionStorage} from '@unikue/ts-lang-utils';
|
|
66
|
+
import { ArrayUtils } from '@unikue/ts-lang-utils';
|
|
67
|
+
import { BooleanUtils } from '@unikue/ts-lang-utils';
|
|
68
|
+
import { ColorUtils } from '@unikue/ts-lang-utils';
|
|
69
|
+
import { DateUtils } from '@unikue/ts-lang-utils';
|
|
70
|
+
import { DurationUtils } from '@unikue/ts-lang-utils';
|
|
71
|
+
import { ElementUtils } from '@unikue/ts-lang-utils';
|
|
72
|
+
import { FileUtils } from '@unikue/ts-lang-utils';
|
|
73
|
+
import { ImageUtils } from '@unikue/ts-lang-utils';
|
|
74
|
+
import { JsonUtils } from '@unikue/ts-lang-utils';
|
|
75
|
+
import { MapUtils } from '@unikue/ts-lang-utils';
|
|
76
|
+
import { NanoidUtils } from '@unikue/ts-lang-utils';
|
|
77
|
+
import { NumberUtils } from '@unikue/ts-lang-utils';
|
|
78
|
+
import { ObjectUtils } from '@unikue/ts-lang-utils';
|
|
79
|
+
import { RandomUtils } from '@unikue/ts-lang-utils';
|
|
80
|
+
import { RegexUtils } from '@unikue/ts-lang-utils';
|
|
81
|
+
import { StringUtils } from '@unikue/ts-lang-utils';
|
|
82
|
+
import { ThreadUtils } from '@unikue/ts-lang-utils';
|
|
83
|
+
import { TreeUtils } from '@unikue/ts-lang-utils';
|
|
84
|
+
import { CookieStorage } from '@unikue/ts-lang-utils';
|
|
85
|
+
import { LocalStorage } from '@unikue/ts-lang-utils';
|
|
86
|
+
import { SessionStorage } from '@unikue/ts-lang-utils';
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
享受您和 `ts-lang-utils` 的编程之旅吧 ✌️
|
package/README.zh-TW.md
CHANGED
|
@@ -63,27 +63,27 @@ $ npm install @unikue/ts-lang-utils --save
|
|
|
63
63
|
然后,您可以使用以下命令来导入组件:
|
|
64
64
|
|
|
65
65
|
```jsx | pure
|
|
66
|
-
import {ArrayUtils} from '@unikue/ts-lang-utils';
|
|
67
|
-
import {BooleanUtils} from '@unikue/ts-lang-utils';
|
|
68
|
-
import {ColorUtils} from '@unikue/ts-lang-utils';
|
|
69
|
-
import {DateUtils} from '@unikue/ts-lang-utils';
|
|
70
|
-
import {DurationUtils} from '@unikue/ts-lang-utils';
|
|
71
|
-
import {ElementUtils} from '@unikue/ts-lang-utils';
|
|
72
|
-
import {FileUtils} from '@unikue/ts-lang-utils';
|
|
73
|
-
import {ImageUtils} from '@unikue/ts-lang-utils';
|
|
74
|
-
import {JsonUtils} from '@unikue/ts-lang-utils';
|
|
75
|
-
import {MapUtils} from '@unikue/ts-lang-utils';
|
|
76
|
-
import {NanoidUtils} from '@unikue/ts-lang-utils';
|
|
77
|
-
import {NumberUtils} from '@unikue/ts-lang-utils';
|
|
78
|
-
import {ObjectUtils} from '@unikue/ts-lang-utils';
|
|
79
|
-
import {RandomUtils} from '@unikue/ts-lang-utils';
|
|
80
|
-
import {RegexUtils} from '@unikue/ts-lang-utils';
|
|
81
|
-
import {StringUtils} from '@unikue/ts-lang-utils';
|
|
82
|
-
import {ThreadUtils} from '@unikue/ts-lang-utils';
|
|
83
|
-
import {TreeUtils} from '@unikue/ts-lang-utils';
|
|
84
|
-
import {CookieStorage} from '@unikue/ts-lang-utils';
|
|
85
|
-
import {LocalStorage} from '@unikue/ts-lang-utils';
|
|
86
|
-
import {SessionStorage} from '@unikue/ts-lang-utils';
|
|
66
|
+
import { ArrayUtils } from '@unikue/ts-lang-utils';
|
|
67
|
+
import { BooleanUtils } from '@unikue/ts-lang-utils';
|
|
68
|
+
import { ColorUtils } from '@unikue/ts-lang-utils';
|
|
69
|
+
import { DateUtils } from '@unikue/ts-lang-utils';
|
|
70
|
+
import { DurationUtils } from '@unikue/ts-lang-utils';
|
|
71
|
+
import { ElementUtils } from '@unikue/ts-lang-utils';
|
|
72
|
+
import { FileUtils } from '@unikue/ts-lang-utils';
|
|
73
|
+
import { ImageUtils } from '@unikue/ts-lang-utils';
|
|
74
|
+
import { JsonUtils } from '@unikue/ts-lang-utils';
|
|
75
|
+
import { MapUtils } from '@unikue/ts-lang-utils';
|
|
76
|
+
import { NanoidUtils } from '@unikue/ts-lang-utils';
|
|
77
|
+
import { NumberUtils } from '@unikue/ts-lang-utils';
|
|
78
|
+
import { ObjectUtils } from '@unikue/ts-lang-utils';
|
|
79
|
+
import { RandomUtils } from '@unikue/ts-lang-utils';
|
|
80
|
+
import { RegexUtils } from '@unikue/ts-lang-utils';
|
|
81
|
+
import { StringUtils } from '@unikue/ts-lang-utils';
|
|
82
|
+
import { ThreadUtils } from '@unikue/ts-lang-utils';
|
|
83
|
+
import { TreeUtils } from '@unikue/ts-lang-utils';
|
|
84
|
+
import { CookieStorage } from '@unikue/ts-lang-utils';
|
|
85
|
+
import { LocalStorage } from '@unikue/ts-lang-utils';
|
|
86
|
+
import { SessionStorage } from '@unikue/ts-lang-utils';
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
享受您和 `ts-lang-utils` 的編程之旅吧 ✌️
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function formatDateTime(date?: Date, format?: string): string | undefined;
|
|
1
|
+
export declare function formatDateTime(date?: Date | null, format?: string): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfDay(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfDay(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfMonth(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfMonth(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfYear(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfYear(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfDay(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfDay(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfMonth(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfMonth(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfYear(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfYear(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isTomorrow(date?: Date): boolean;
|
|
1
|
+
export declare function isTomorrow(date?: Date | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isWeekend(date?: Date): boolean;
|
|
1
|
+
export declare function isWeekend(date?: Date | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isYesterday(date?: Date): boolean;
|
|
1
|
+
export declare function isYesterday(date?: Date | null): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatSeconds(seconds?: number | null, forceHour?: boolean): string | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/util/DurationUtils/formatSeconds.ts
|
|
20
|
+
var formatSeconds_exports = {};
|
|
21
|
+
__export(formatSeconds_exports, {
|
|
22
|
+
formatSeconds: () => formatSeconds
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(formatSeconds_exports);
|
|
25
|
+
function formatSeconds(seconds, forceHour = false) {
|
|
26
|
+
if (seconds === void 0 || seconds === null) {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
if (seconds < 0 || !Number.isFinite(seconds)) {
|
|
30
|
+
return forceHour ? "00:00:00" : "00:00";
|
|
31
|
+
}
|
|
32
|
+
const h = Math.floor(seconds / 3600);
|
|
33
|
+
const m = Math.floor(seconds % 3600 / 60);
|
|
34
|
+
const s = Math.floor(seconds % 60);
|
|
35
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
36
|
+
if (h > 0 || forceHour) {
|
|
37
|
+
return `${pad(h)}:${pad(m)}:${pad(s)}`;
|
|
38
|
+
}
|
|
39
|
+
return `${pad(m)}:${pad(s)}`;
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
formatSeconds
|
|
44
|
+
});
|
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/util/DurationUtils/index.ts
|
|
20
20
|
var DurationUtils_exports = {};
|
|
21
21
|
__export(DurationUtils_exports, {
|
|
22
|
+
formatSeconds: () => import_formatSeconds.formatSeconds,
|
|
22
23
|
parseToDays: () => import_parseToDays.parseToDays,
|
|
23
24
|
parseToHours: () => import_parseToHours.parseToHours,
|
|
24
25
|
parseToMillis: () => import_parseToMillis.parseToMillis,
|
|
@@ -29,6 +30,7 @@ __export(DurationUtils_exports, {
|
|
|
29
30
|
parseToYears: () => import_parseToYears.parseToYears
|
|
30
31
|
});
|
|
31
32
|
module.exports = __toCommonJS(DurationUtils_exports);
|
|
33
|
+
var import_formatSeconds = require("./formatSeconds");
|
|
32
34
|
var import_parseToDays = require("./parseToDays");
|
|
33
35
|
var import_parseToHours = require("./parseToHours");
|
|
34
36
|
var import_parseToMillis = require("./parseToMillis");
|
|
@@ -39,6 +41,7 @@ var import_parseToWeeks = require("./parseToWeeks");
|
|
|
39
41
|
var import_parseToYears = require("./parseToYears");
|
|
40
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
43
|
0 && (module.exports = {
|
|
44
|
+
formatSeconds,
|
|
42
45
|
parseToDays,
|
|
43
46
|
parseToHours,
|
|
44
47
|
parseToMillis,
|
|
@@ -28,7 +28,7 @@ function parseToMonths(duration) {
|
|
|
28
28
|
return void 0;
|
|
29
29
|
}
|
|
30
30
|
const result = (0, import_duration.parse)(duration);
|
|
31
|
-
return result === void 0 ? void 0 : result / (1e3 * 31556952 / 12);
|
|
31
|
+
return result === void 0 ? void 0 : Math.round(result / (1e3 * 31556952 / 12));
|
|
32
32
|
}
|
|
33
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
34
|
0 && (module.exports = {
|
|
@@ -28,7 +28,7 @@ function parseToWeeks(duration) {
|
|
|
28
28
|
return void 0;
|
|
29
29
|
}
|
|
30
30
|
const result = (0, import_duration.parse)(duration);
|
|
31
|
-
return result === void 0 ? void 0 : result / (1e3 * 86400 / 7);
|
|
31
|
+
return result === void 0 ? void 0 : Math.round(result / (1e3 * 86400 / 7));
|
|
32
32
|
}
|
|
33
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
34
|
0 && (module.exports = {
|
|
@@ -28,7 +28,7 @@ function parseToYears(duration) {
|
|
|
28
28
|
return void 0;
|
|
29
29
|
}
|
|
30
30
|
const result = (0, import_duration.parse)(duration);
|
|
31
|
-
return result === void 0 ? void 0 : result / (1e3 * 31556952);
|
|
31
|
+
return result === void 0 ? void 0 : Math.round(result / (1e3 * 31556952));
|
|
32
32
|
}
|
|
33
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
34
|
0 && (module.exports = {
|
|
@@ -19,11 +19,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/util/UriUtils/index.ts
|
|
20
20
|
var UriUtils_exports = {};
|
|
21
21
|
__export(UriUtils_exports, {
|
|
22
|
-
appendParam: () => import_appendParam.appendParam
|
|
22
|
+
appendParam: () => import_appendParam.appendParam,
|
|
23
|
+
isHttp: () => import_isHttp.isHttp,
|
|
24
|
+
isHttps: () => import_isHttps.isHttps
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(UriUtils_exports);
|
|
25
27
|
var import_appendParam = require("./appendParam");
|
|
28
|
+
var import_isHttp = require("./isHttp");
|
|
29
|
+
var import_isHttps = require("./isHttps");
|
|
26
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
31
|
0 && (module.exports = {
|
|
28
|
-
appendParam
|
|
32
|
+
appendParam,
|
|
33
|
+
isHttp,
|
|
34
|
+
isHttps
|
|
29
35
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHttp(url?: string | null): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/util/UriUtils/isHttp.ts
|
|
20
|
+
var isHttp_exports = {};
|
|
21
|
+
__export(isHttp_exports, {
|
|
22
|
+
isHttp: () => isHttp
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(isHttp_exports);
|
|
25
|
+
function isHttp(url) {
|
|
26
|
+
return !!url && url.toLowerCase().startsWith("http://");
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
isHttp
|
|
31
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHttps(url?: string | null): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/util/UriUtils/isHttps.ts
|
|
20
|
+
var isHttps_exports = {};
|
|
21
|
+
__export(isHttps_exports, {
|
|
22
|
+
isHttps: () => isHttps
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(isHttps_exports);
|
|
25
|
+
function isHttps(url) {
|
|
26
|
+
return !!url && url.toLowerCase().startsWith("https://");
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
isHttps
|
|
31
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function formatDateTime(date?: Date, format?: string): string | undefined;
|
|
1
|
+
export declare function formatDateTime(date?: Date | null, format?: string): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfDay(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfDay(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfMonth(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfMonth(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEndOfYear(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getEndOfYear(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfDay(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfDay(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfMonth(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfMonth(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getStartOfYear(date?: Date): Date | undefined;
|
|
1
|
+
export declare function getStartOfYear(date?: Date | null): Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isTomorrow(date?: Date): boolean;
|
|
1
|
+
export declare function isTomorrow(date?: Date | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isWeekend(date?: Date): boolean;
|
|
1
|
+
export declare function isWeekend(date?: Date | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isYesterday(date?: Date): boolean;
|
|
1
|
+
export declare function isYesterday(date?: Date | null): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatSeconds(seconds?: number | null, forceHour?: boolean): string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function formatSeconds(seconds) {
|
|
2
|
+
var forceHour = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3
|
+
if (seconds === undefined || seconds === null) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
if (seconds < 0 || !Number.isFinite(seconds)) {
|
|
7
|
+
return forceHour ? '00:00:00' : '00:00';
|
|
8
|
+
}
|
|
9
|
+
var h = Math.floor(seconds / 3600);
|
|
10
|
+
var m = Math.floor(seconds % 3600 / 60);
|
|
11
|
+
var s = Math.floor(seconds % 60);
|
|
12
|
+
var pad = function pad(n) {
|
|
13
|
+
return String(n).padStart(2, '0');
|
|
14
|
+
};
|
|
15
|
+
if (h > 0 || forceHour) {
|
|
16
|
+
return "".concat(pad(h), ":").concat(pad(m), ":").concat(pad(s));
|
|
17
|
+
}
|
|
18
|
+
return "".concat(pad(m), ":").concat(pad(s));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHttp(url?: string | null): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHttps(url?: string | null): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unikue/ts-lang-utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"title": "TsLangUtils",
|
|
5
5
|
"description": "Common lang utilities for typescript",
|
|
6
6
|
"homepage": "https://unikueltd.github.io/ts-lang-utils",
|
|
@@ -48,13 +48,14 @@
|
|
|
48
48
|
"lint": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
49
49
|
"lint:fix": "eslint --fix \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
50
50
|
"test": "jest",
|
|
51
|
-
"test:coverage": "del-cli ./coverage && jest --coverage --coverageDirectory ./coverage"
|
|
51
|
+
"test:coverage": "del-cli ./coverage && jest --coverage --coverageDirectory ./coverage",
|
|
52
|
+
"upgrade": "npx npm-check-updates --target semver -u"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@babel/runtime": "^7.29.7",
|
|
55
56
|
"@imranbarbhuiya/duration": "^5.1.8",
|
|
56
57
|
"lodash": "^4.18.1",
|
|
57
|
-
"nanoid": "^3.3.
|
|
58
|
+
"nanoid": "^3.3.15",
|
|
58
59
|
"universal-cookie": "^8.1.2"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
@@ -62,19 +63,19 @@
|
|
|
62
63
|
"@eslint/js": "^10.0.1",
|
|
63
64
|
"@types/jest": "^30.0.0",
|
|
64
65
|
"@types/lodash": "^4.17.24",
|
|
65
|
-
"@unikue/babel-plugin-remove-comment": "^1.2.
|
|
66
|
-
"@unikue/typedoc-plugin-raw-content": "^1.1.
|
|
67
|
-
"@unikue/typedoc-theme-dumi": "^1.1.
|
|
66
|
+
"@unikue/babel-plugin-remove-comment": "^1.2.1",
|
|
67
|
+
"@unikue/typedoc-plugin-raw-content": "^1.1.1",
|
|
68
|
+
"@unikue/typedoc-theme-dumi": "^1.1.3",
|
|
68
69
|
"del-cli": "^7.0.0",
|
|
69
|
-
"eslint": "^10.
|
|
70
|
+
"eslint": "^10.5.0",
|
|
70
71
|
"eslint-plugin-jest": "^29.15.2",
|
|
71
|
-
"father": "^4.6.
|
|
72
|
+
"father": "^4.6.23",
|
|
72
73
|
"gh-pages": "^6.3.0",
|
|
73
|
-
"globals": "^17.
|
|
74
|
+
"globals": "^17.7.0",
|
|
74
75
|
"ts-jest": "^29.4.11",
|
|
75
76
|
"typedoc": "~0.28.19",
|
|
76
77
|
"typescript": "^6.0.3",
|
|
77
|
-
"typescript-eslint": "^8.
|
|
78
|
+
"typescript-eslint": "^8.62.0"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
80
81
|
"typescript": ">=4.0.0"
|