@alarido/ts-utils 1.0.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alarido <alarido.su@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ "# ts-utils"
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Struct to describe a divergent value between two structures.
3
+ */
4
+ export interface DivergentValueInfo {
5
+ name: string;
6
+ value: any;
7
+ oldValue: any;
8
+ }
9
+ /**
10
+ * Complex/compound comparison tools.
11
+ */
12
+ declare class CompareUtils {
13
+ constructor();
14
+ /**
15
+ * List values diverging between the (sa) and (sb) structures.
16
+ * If an empty list is returned, it means (sa) and (sb) are probably equal.
17
+ * To enable strict comparison, pass true to strictCompare parameter.
18
+ *
19
+ * @param sa: any
20
+ * @param sb: any
21
+ * @param strictCompare: boolean = false
22
+ * @returns DivergentValueInfo[]
23
+ */
24
+ getDivergentValues(sa: any, sb: any, strictCompare?: boolean): DivergentValueInfo[];
25
+ /**
26
+ * Compares dates.
27
+ *
28
+ * @param d1: Date
29
+ * @param d2: Date
30
+ * @returns boolean
31
+ */
32
+ areSameDate(d1: Date, d2: Date): boolean;
33
+ /**
34
+ * Checks if both structures have any divergent values in between.
35
+ *
36
+ * @param v1: any
37
+ * @param v2: any
38
+ * @returns boolean
39
+ */
40
+ areDivergent(v1: any, v2: any): boolean;
41
+ }
42
+ export declare const compares: CompareUtils;
43
+ export {};
44
+ //# sourceMappingURL=compares.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compares.d.ts","sourceRoot":"","sources":["../../src/functions/compares.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;CACjB;AAED;;GAEG;AACH,cAAM,YAAY;;IAGd;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,aAAa,GAAE,OAAe,GAAG,kBAAkB,EAAE;IAqC1F;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO;IAQxC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,GAAG,OAAO;CAK1C;AAED,eAAO,MAAM,QAAQ,cAAqB,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compares = void 0;
4
+ const dates_1 = require("./dates");
5
+ ;
6
+ /**
7
+ * Complex/compound comparison tools.
8
+ */
9
+ class CompareUtils {
10
+ constructor() { }
11
+ /**
12
+ * List values diverging between the (sa) and (sb) structures.
13
+ * If an empty list is returned, it means (sa) and (sb) are probably equal.
14
+ * To enable strict comparison, pass true to strictCompare parameter.
15
+ *
16
+ * @param sa: any
17
+ * @param sb: any
18
+ * @param strictCompare: boolean = false
19
+ * @returns DivergentValueInfo[]
20
+ */
21
+ getDivergentValues(sa, sb, strictCompare = false) {
22
+ const keys_a = Object.keys(sa);
23
+ const keys_b = Object.keys(sb);
24
+ const is_object = (obj) => obj != null && typeof obj === 'object';
25
+ let result = [];
26
+ if (keys_a.length !== keys_b.length) {
27
+ return [{
28
+ name: "*",
29
+ value: (sa),
30
+ oldValue: (sb)
31
+ }];
32
+ }
33
+ for (const key of keys_a) {
34
+ const val_a = sa[key];
35
+ const val_b = sb[key];
36
+ let inequal = false;
37
+ //
38
+ if (val_a instanceof Date && val_b instanceof Date) {
39
+ inequal = !this.areSameDate(val_a, val_b);
40
+ }
41
+ else if (val_a instanceof Date) {
42
+ const date_b = dates_1.dates.parse(val_b);
43
+ inequal = !this.areSameDate(val_a, date_b);
44
+ }
45
+ else if (val_b instanceof Date) {
46
+ const date_a = dates_1.dates.parse(val_a);
47
+ inequal = !this.areSameDate(date_a, val_b);
48
+ }
49
+ else if (is_object(val_a) && is_object(val_b)) {
50
+ inequal = this.areDivergent(val_a, val_b);
51
+ }
52
+ else {
53
+ inequal = !(strictCompare ? (val_a === val_b) : (val_a == val_b));
54
+ }
55
+ }
56
+ return result;
57
+ }
58
+ /**
59
+ * Compares dates.
60
+ *
61
+ * @param d1: Date
62
+ * @param d2: Date
63
+ * @returns boolean
64
+ */
65
+ areSameDate(d1, d2) {
66
+ if ((!(d1 instanceof Date)) || (!(d2 instanceof Date))) {
67
+ return false;
68
+ }
69
+ return (d1.valueOf() == d2.valueOf());
70
+ }
71
+ /**
72
+ * Checks if both structures have any divergent values in between.
73
+ *
74
+ * @param v1: any
75
+ * @param v2: any
76
+ * @returns boolean
77
+ */
78
+ areDivergent(v1, v2) {
79
+ const divergent = this.getDivergentValues(v1, v2);
80
+ return (divergent.length > 0);
81
+ }
82
+ }
83
+ exports.compares = new CompareUtils();
84
+ //# sourceMappingURL=compares.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compares.js","sourceRoot":"","sources":["../../src/functions/compares.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAS/B,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY;IACd,gBAAe,CAAC;IAEhB;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAO,EAAE,EAAO,EAAE,gBAAyB,KAAK;QAC/D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;QACvE,IAAI,MAAM,GAAyB,EAAE,CAAC;QAEtC,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;YAClC,OAAO,CAAC;oBACJ,IAAI,EAAE,GAAG;oBACT,KAAK,EAAE,CAAC,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC,EAAE,CAAC;iBACjB,CAAC,CAAC;QACP,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;YACtB,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;YACtB,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,EAAE;YACF,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;gBACjD,OAAO,GAAG,CAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/C,CAAC;iBAAM,IAAI,KAAK,YAAY,IAAI,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AC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;CACJ;AAEY,QAAA,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Date utils
3
+ */
4
+ declare class DateUtils {
5
+ constructor();
6
+ /**
7
+ * Parse the date according the format.
8
+ *
9
+ * @param value: string
10
+ * @param format: string
11
+ * @returns Date
12
+ */
13
+ parse(value: string, format?: string): Date;
14
+ }
15
+ export declare const dates: DateUtils;
16
+ export declare const now: Date;
17
+ export {};
18
+ //# sourceMappingURL=dates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../src/functions/dates.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,cAAM,SAAS;;IAGX;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAqB,GAAG,IAAI;CAuB5D;AAGD,eAAO,MAAM,KAAK,WAAkB,CAAC;AACrC,eAAO,MAAM,GAAG,MAAQ,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.now = exports.dates = void 0;
4
+ /**
5
+ * The current date.
6
+ *
7
+ * @returns Date
8
+ */
9
+ const NOW = () => new Date();
10
+ /**
11
+ * Date utils
12
+ */
13
+ class DateUtils {
14
+ constructor() { }
15
+ /**
16
+ * Parse the date according the format.
17
+ *
18
+ * @param value: string
19
+ * @param format: string
20
+ * @returns Date
21
+ */
22
+ parse(value, format = "yyyy-mm-dd") {
23
+ const normalized = value.replace(/[^a-zA-Z0-9]/g, "-");
24
+ const normalizedFormat = format.toLowerCase().replace(/[^a-zA-Z0-9]/g, "-");
25
+ const formatItems = normalizedFormat.split("-");
26
+ const dateItems = normalized.split("-");
27
+ const yearIndex = formatItems.indexOf("yyyy");
28
+ const monthIndex = formatItems.indexOf("mm");
29
+ const dayIndex = formatItems.indexOf("dd");
30
+ const hourIndex = formatItems.indexOf("hh");
31
+ const minutesIndex = formatItems.indexOf("ii");
32
+ const secondsIndex = formatItems.indexOf("ss");
33
+ const year = (yearIndex >= 0) ? dateItems[yearIndex] : 0;
34
+ const month = (monthIndex >= 0) ? dateItems[monthIndex] : 1;
35
+ const day = (dayIndex >= 0) ? dateItems[dayIndex] : 0;
36
+ const hour = (hourIndex >= 0) ? dateItems[hourIndex] : 0;
37
+ const minute = (minutesIndex >= 0) ? dateItems[minutesIndex] : 0;
38
+ const second = (secondsIndex >= 0) ? dateItems[secondsIndex] : 0;
39
+ return new Date(year, month - 1, day, hour, minute, second);
40
+ }
41
+ }
42
+ exports.dates = new DateUtils();
43
+ exports.now = NOW();
44
+ //# sourceMappingURL=dates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.js","sourceRoot":"","sources":["../../src/functions/dates.ts"],"names":[],"mappings":";;;AACA;;;;GAIG;AACH,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,SAAS;IACX,gBAAe,CAAC;IAEhB;;;;;;OAMG;IACH,KAAK,CAAC,KAAa,EAAE,SAAiB,YAAY;QAC9C,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QAC5E,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAExC,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,WAAW,CAAC,O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C"}
@@ -0,0 +1,13 @@
1
+ import * as Compares from "./functions/compares";
2
+ /**
3
+ * exports
4
+ */
5
+ export declare const dates: {
6
+ parse(value: string, format?: string): Date;
7
+ };
8
+ export declare const compares: {
9
+ getDivergentValues(sa: any, sb: any, strictCompare?: boolean): Compares.DivergentValueInfo[];
10
+ areSameDate(d1: Date, d2: Date): boolean;
11
+ areDivergent(v1: any, v2: any): boolean;
12
+ };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AAEH,eAAO,MAAM,KAAK;;CAAc,CAAC;AACjC,eAAO,MAAM,QAAQ;;;;CAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.compares = exports.dates = void 0;
37
+ const Dates = __importStar(require("./functions/dates"));
38
+ const Compares = __importStar(require("./functions/compares"));
39
+ /**
40
+ * exports
41
+ */
42
+ exports.dates = Dates.dates;
43
+ exports.compares = Compares.compares;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAC3C,+DAAiD;AAEjD;;GAEG;AAEU,QAAA,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AACpB,QAAA,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@alarido/ts-utils",
3
+ "version": "1.0.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "\"# ts-utils\"",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "tsc",
13
+ "prepublish": "npm run build"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/collei/ts-utils.git"
18
+ },
19
+ "keywords": [],
20
+ "author": "",
21
+ "license": "MIT",
22
+ "bugs": {
23
+ "url": "https://github.com/collei/ts-utils/issues"
24
+ },
25
+ "homepage": "https://github.com/collei/ts-utils#readme",
26
+ "devDependencies": {
27
+ "@types/node": "^25.0.3",
28
+ "typescript": "^5.9.3"
29
+ }
30
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ // Visit https://aka.ms/tsconfig to read more about this file
3
+ "compilerOptions": {
4
+ // File Layout
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+
8
+ // Environment Settings
9
+ // See also https://aka.ms/tsconfig/module
10
+ "module": "nodenext",
11
+ "target": "esnext",
12
+ //"types": [],
13
+ // For nodejs:
14
+ "lib": ["esnext"],
15
+ "types": ["node"],
16
+ // and npm install -D @types/node
17
+
18
+ // Other Outputs
19
+ "sourceMap": true,
20
+ "declaration": true,
21
+ "declarationMap": true,
22
+
23
+ // Stricter Typechecking Options
24
+ "noUncheckedIndexedAccess": true,
25
+ "exactOptionalPropertyTypes": true,
26
+
27
+ // Style Options
28
+ // "noImplicitReturns": true,
29
+ // "noImplicitOverride": true,
30
+ // "noUnusedLocals": true,
31
+ // "noUnusedParameters": true,
32
+ // "noFallthroughCasesInSwitch": true,
33
+ // "noPropertyAccessFromIndexSignature": true,
34
+
35
+ // Recommended Options
36
+ "strict": true,
37
+ "jsx": "react-jsx",
38
+ "verbatimModuleSyntax": false,
39
+ "isolatedModules": true,
40
+ "noUncheckedSideEffectImports": true,
41
+ "moduleDetection": "force",
42
+ "skipLibCheck": true,
43
+ }
44
+ }