namirasoft-core 1.2.13 → 1.2.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.
- package/.gitlab-ci.yml +13 -13
- package/dist/EncryptionOperation.d.ts +2 -2
- package/dist/EncryptionOperation.js +21 -10
- package/dist/EncryptionOperation.js.map +1 -1
- package/dist/SignOperation.d.ts +4 -0
- package/dist/SignOperation.js +14 -0
- package/dist/SignOperation.js.map +1 -0
- package/package.json +15 -15
- package/src/BaseDatabaseRow.ts +6 -6
- package/src/BaseServer.ts +72 -72
- package/src/ConvertService.ts +98 -98
- package/src/Countries.ts +486 -486
- package/src/Country.ts +21 -21
- package/src/CountryOperation.ts +98 -98
- package/src/EncryptionOperation.ts +40 -29
- package/src/ErrorOperation.ts +13 -13
- package/src/FileOperation.ts +50 -50
- package/src/GeoOperation.ts +18 -18
- package/src/HTTPError.ts +8 -8
- package/src/HTTPMethod.ts +6 -6
- package/src/HashOperation.ts +24 -24
- package/src/IStorage.ts +5 -5
- package/src/IStorageLocal.ts +16 -16
- package/src/IStorageMemory.ts +17 -17
- package/src/ObjectService.ts +23 -23
- package/src/PackageService.ts +66 -66
- package/src/PhoneOperation.ts +8 -8
- package/src/StringOperation.ts +18 -18
- package/src/TimeOperation.ts +262 -262
- package/src/URLOperation.ts +54 -54
- package/src/VersionOperation.ts +46 -46
- package/src/index.ts +23 -23
- package/tsconfig.json +29 -29
package/src/VersionOperation.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export class VersionOperation
|
|
2
|
-
{
|
|
3
|
-
static forEach(v1: string, v2: string, handler: (e1: number, e2: number) => boolean, onEqual: boolean): boolean
|
|
4
|
-
{
|
|
5
|
-
if (!v1 || !v2)
|
|
6
|
-
return false;
|
|
7
|
-
let t1s = v1.split('.');
|
|
8
|
-
let t2s = v2.split('.');
|
|
9
|
-
let len = Math.max(t1s.length, t2s.length);
|
|
10
|
-
for (let i = 0; i < len; i++)
|
|
11
|
-
{
|
|
12
|
-
let e1 = 0;
|
|
13
|
-
let e2 = 0;
|
|
14
|
-
if (i < t1s.length)
|
|
15
|
-
e1 = parseInt(t1s[i]);
|
|
16
|
-
if (i < t2s.length)
|
|
17
|
-
e2 = parseInt(t2s[i]);
|
|
18
|
-
if (e1 != e2)
|
|
19
|
-
return handler(e1, e2);
|
|
20
|
-
}
|
|
21
|
-
return onEqual;
|
|
22
|
-
}
|
|
23
|
-
static isGreaterThan(v1: string, v2: string): boolean
|
|
24
|
-
{
|
|
25
|
-
return this.forEach(v1, v2, (e1: number, e2: number) => e1 > e2, false);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static isLessThan(v1: string, v2: string): boolean
|
|
29
|
-
{
|
|
30
|
-
return this.forEach(v1, v2, (e1: number, e2: number) => e1 < e2, false);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static isEqual(v1: string, v2: string): boolean
|
|
34
|
-
{
|
|
35
|
-
return this.forEach(v1, v2, () => false, true);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static isGreaterThanOrEqual(v1: string, v2: string): boolean
|
|
39
|
-
{
|
|
40
|
-
return this.forEach(v1, v2, (e1: number, e2: number) => e1 > e2, true);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static isLessThanOrEqual(v1: string, v2: string): boolean
|
|
44
|
-
{
|
|
45
|
-
return this.forEach(v1, v2, (e1: number, e2: number) => e1 < e2, true);
|
|
46
|
-
}
|
|
1
|
+
export class VersionOperation
|
|
2
|
+
{
|
|
3
|
+
static forEach(v1: string, v2: string, handler: (e1: number, e2: number) => boolean, onEqual: boolean): boolean
|
|
4
|
+
{
|
|
5
|
+
if (!v1 || !v2)
|
|
6
|
+
return false;
|
|
7
|
+
let t1s = v1.split('.');
|
|
8
|
+
let t2s = v2.split('.');
|
|
9
|
+
let len = Math.max(t1s.length, t2s.length);
|
|
10
|
+
for (let i = 0; i < len; i++)
|
|
11
|
+
{
|
|
12
|
+
let e1 = 0;
|
|
13
|
+
let e2 = 0;
|
|
14
|
+
if (i < t1s.length)
|
|
15
|
+
e1 = parseInt(t1s[i]);
|
|
16
|
+
if (i < t2s.length)
|
|
17
|
+
e2 = parseInt(t2s[i]);
|
|
18
|
+
if (e1 != e2)
|
|
19
|
+
return handler(e1, e2);
|
|
20
|
+
}
|
|
21
|
+
return onEqual;
|
|
22
|
+
}
|
|
23
|
+
static isGreaterThan(v1: string, v2: string): boolean
|
|
24
|
+
{
|
|
25
|
+
return this.forEach(v1, v2, (e1: number, e2: number) => e1 > e2, false);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static isLessThan(v1: string, v2: string): boolean
|
|
29
|
+
{
|
|
30
|
+
return this.forEach(v1, v2, (e1: number, e2: number) => e1 < e2, false);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static isEqual(v1: string, v2: string): boolean
|
|
34
|
+
{
|
|
35
|
+
return this.forEach(v1, v2, () => false, true);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static isGreaterThanOrEqual(v1: string, v2: string): boolean
|
|
39
|
+
{
|
|
40
|
+
return this.forEach(v1, v2, (e1: number, e2: number) => e1 > e2, true);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static isLessThanOrEqual(v1: string, v2: string): boolean
|
|
44
|
+
{
|
|
45
|
+
return this.forEach(v1, v2, (e1: number, e2: number) => e1 < e2, true);
|
|
46
|
+
}
|
|
47
47
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export * from "./BaseDatabaseRow";
|
|
2
|
-
export * from "./BaseServer";
|
|
3
|
-
export * from "./Countries";
|
|
4
|
-
export * from "./ConvertService";
|
|
5
|
-
export * from "./Country";
|
|
6
|
-
export * from "./CountryOperation";
|
|
7
|
-
export * from "./EncryptionOperation";
|
|
8
|
-
export * from "./ErrorOperation";
|
|
9
|
-
export * from "./FileOperation";
|
|
10
|
-
export * from "./GeoOperation";
|
|
11
|
-
export * from "./HashOperation";
|
|
12
|
-
export * from "./HTTPError";
|
|
13
|
-
export * from "./HTTPMethod";
|
|
14
|
-
export * from "./IStorage";
|
|
15
|
-
export * from "./IStorageLocal";
|
|
16
|
-
export * from "./IStorageMemory";
|
|
17
|
-
export * from "./ObjectService";
|
|
18
|
-
export * from "./PackageService";
|
|
19
|
-
export * from "./ParsedNameValue";
|
|
20
|
-
export * from "./PhoneOperation";
|
|
21
|
-
export * from "./StringOperation";
|
|
22
|
-
export * from "./TimeOperation";
|
|
23
|
-
export * from "./URLOperation";
|
|
1
|
+
export * from "./BaseDatabaseRow";
|
|
2
|
+
export * from "./BaseServer";
|
|
3
|
+
export * from "./Countries";
|
|
4
|
+
export * from "./ConvertService";
|
|
5
|
+
export * from "./Country";
|
|
6
|
+
export * from "./CountryOperation";
|
|
7
|
+
export * from "./EncryptionOperation";
|
|
8
|
+
export * from "./ErrorOperation";
|
|
9
|
+
export * from "./FileOperation";
|
|
10
|
+
export * from "./GeoOperation";
|
|
11
|
+
export * from "./HashOperation";
|
|
12
|
+
export * from "./HTTPError";
|
|
13
|
+
export * from "./HTTPMethod";
|
|
14
|
+
export * from "./IStorage";
|
|
15
|
+
export * from "./IStorageLocal";
|
|
16
|
+
export * from "./IStorageMemory";
|
|
17
|
+
export * from "./ObjectService";
|
|
18
|
+
export * from "./PackageService";
|
|
19
|
+
export * from "./ParsedNameValue";
|
|
20
|
+
export * from "./PhoneOperation";
|
|
21
|
+
export * from "./StringOperation";
|
|
22
|
+
export * from "./TimeOperation";
|
|
23
|
+
export * from "./URLOperation";
|
|
24
24
|
export * from "./VersionOperation";
|
package/tsconfig.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"lib": [
|
|
8
|
-
"es6",
|
|
9
|
-
"dom"
|
|
10
|
-
],
|
|
11
|
-
"allowJs": false,
|
|
12
|
-
"checkJs": false,
|
|
13
|
-
"strict": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"declaration": true,
|
|
18
|
-
"noUnusedLocals": true,
|
|
19
|
-
"noUnusedParameters": true,
|
|
20
|
-
"noImplicitAny": true,
|
|
21
|
-
"noImplicitOverride": true,
|
|
22
|
-
"noImplicitReturns": true,
|
|
23
|
-
"noImplicitThis": true,
|
|
24
|
-
"skipLibCheck": true,
|
|
25
|
-
"allowSyntheticDefaultImports": true,
|
|
26
|
-
"forceConsistentCasingInFileNames": true,
|
|
27
|
-
"noFallthroughCasesInSwitch": true,
|
|
28
|
-
"isolatedModules": false,
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"lib": [
|
|
8
|
+
"es6",
|
|
9
|
+
"dom"
|
|
10
|
+
],
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"checkJs": false,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noImplicitAny": true,
|
|
21
|
+
"noImplicitOverride": true,
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noImplicitThis": true,
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"allowSyntheticDefaultImports": true,
|
|
26
|
+
"forceConsistentCasingInFileNames": true,
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
"isolatedModules": false,
|
|
29
|
+
}
|
|
30
30
|
}
|