namirasoft-core 1.4.12 → 1.4.13
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/dist/EncryptionOperation.js +17 -7
- package/dist/EncryptionOperation.js.map +1 -1
- package/dist/HashOperation.js +17 -7
- package/dist/HashOperation.js.map +1 -1
- package/dist/PhoneOperation.js +17 -7
- package/dist/PhoneOperation.js.map +1 -1
- package/dist/SortItem.d.ts +24 -0
- package/dist/SortItem.js +75 -0
- package/dist/SortItem.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/BaseDatabaseRow.ts +6 -6
- package/src/BaseMetaColumn.ts +13 -13
- package/src/BaseMetaTable.ts +24 -24
- package/src/BaseServer.ts +107 -107
- package/src/CacheService.ts +57 -57
- package/src/ConsoleOperation.ts +68 -68
- package/src/ConvertService.ts +100 -100
- package/src/CookieService.ts +33 -33
- package/src/Countries.ts +486 -486
- package/src/Country.ts +21 -21
- package/src/CountryOperation.ts +98 -98
- package/src/EncodingOperation.ts +12 -12
- package/src/EncryptionOperation.ts +40 -40
- package/src/EnvService.ts +22 -22
- package/src/ErrorOperation.ts +13 -13
- package/src/FileOperation.ts +57 -57
- package/src/FilterItem.ts +128 -128
- package/src/FilterItemColumnType.ts +6 -6
- package/src/FilterItemOperator.ts +51 -51
- 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/IStorageCookie.ts +52 -52
- package/src/IStorageJsonFile.ts +45 -45
- package/src/IStorageLocal.ts +16 -16
- package/src/IStorageMemory.ts +17 -17
- package/src/NamingConvention.ts +107 -107
- package/src/ObjectService.ts +27 -27
- package/src/PackageService.ts +76 -76
- package/src/PhoneOperation.ts +8 -8
- package/src/PriceOperation.ts +18 -18
- package/src/RegexTemplate.ts +7 -7
- package/src/SearchOperation.ts +29 -29
- package/src/SortItem.ts +89 -0
- 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 +40 -39
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,40 +1,41 @@
|
|
|
1
|
-
export * from "./BaseDatabaseRow";
|
|
2
|
-
export * from "./BaseMetaColumn";
|
|
3
|
-
export * from "./BaseMetaTable";
|
|
4
|
-
export * from "./BaseServer";
|
|
5
|
-
export * from "./CacheService";
|
|
6
|
-
export * from "./ConsoleOperation";
|
|
7
|
-
export * from "./CookieService";
|
|
8
|
-
export * from "./Countries";
|
|
9
|
-
export * from "./ConvertService";
|
|
10
|
-
export * from "./Country";
|
|
11
|
-
export * from "./CountryOperation";
|
|
12
|
-
export * from "./EncodingOperation";
|
|
13
|
-
export * from "./EncryptionOperation";
|
|
14
|
-
export * from "./EnvService";
|
|
15
|
-
export * from "./ErrorOperation";
|
|
16
|
-
export * from "./FileOperation";
|
|
17
|
-
export * from "./FilterItem";
|
|
18
|
-
export * from "./FilterItemColumnType";
|
|
19
|
-
export * from "./FilterItemOperator";
|
|
20
|
-
export * from "./GeoOperation";
|
|
21
|
-
export * from "./HashOperation";
|
|
22
|
-
export * from "./HTTPError";
|
|
23
|
-
export * from "./HTTPMethod";
|
|
24
|
-
export * from "./IStorage";
|
|
25
|
-
export * from "./IStorageCookie";
|
|
26
|
-
export * from "./IStorageJsonFile";
|
|
27
|
-
export * from "./IStorageLocal";
|
|
28
|
-
export * from "./IStorageMemory";
|
|
29
|
-
export * from "./NamingConvention";
|
|
30
|
-
export * from "./ObjectService";
|
|
31
|
-
export * from "./PackageService";
|
|
32
|
-
export * from "./ParsedNameValue";
|
|
33
|
-
export * from "./PhoneOperation";
|
|
34
|
-
export * from "./PriceOperation";
|
|
35
|
-
export * from "./RegexTemplate";
|
|
36
|
-
export * from "./SearchOperation";
|
|
37
|
-
export * from "./
|
|
38
|
-
export * from "./
|
|
39
|
-
export * from "./
|
|
1
|
+
export * from "./BaseDatabaseRow";
|
|
2
|
+
export * from "./BaseMetaColumn";
|
|
3
|
+
export * from "./BaseMetaTable";
|
|
4
|
+
export * from "./BaseServer";
|
|
5
|
+
export * from "./CacheService";
|
|
6
|
+
export * from "./ConsoleOperation";
|
|
7
|
+
export * from "./CookieService";
|
|
8
|
+
export * from "./Countries";
|
|
9
|
+
export * from "./ConvertService";
|
|
10
|
+
export * from "./Country";
|
|
11
|
+
export * from "./CountryOperation";
|
|
12
|
+
export * from "./EncodingOperation";
|
|
13
|
+
export * from "./EncryptionOperation";
|
|
14
|
+
export * from "./EnvService";
|
|
15
|
+
export * from "./ErrorOperation";
|
|
16
|
+
export * from "./FileOperation";
|
|
17
|
+
export * from "./FilterItem";
|
|
18
|
+
export * from "./FilterItemColumnType";
|
|
19
|
+
export * from "./FilterItemOperator";
|
|
20
|
+
export * from "./GeoOperation";
|
|
21
|
+
export * from "./HashOperation";
|
|
22
|
+
export * from "./HTTPError";
|
|
23
|
+
export * from "./HTTPMethod";
|
|
24
|
+
export * from "./IStorage";
|
|
25
|
+
export * from "./IStorageCookie";
|
|
26
|
+
export * from "./IStorageJsonFile";
|
|
27
|
+
export * from "./IStorageLocal";
|
|
28
|
+
export * from "./IStorageMemory";
|
|
29
|
+
export * from "./NamingConvention";
|
|
30
|
+
export * from "./ObjectService";
|
|
31
|
+
export * from "./PackageService";
|
|
32
|
+
export * from "./ParsedNameValue";
|
|
33
|
+
export * from "./PhoneOperation";
|
|
34
|
+
export * from "./PriceOperation";
|
|
35
|
+
export * from "./RegexTemplate";
|
|
36
|
+
export * from "./SearchOperation";
|
|
37
|
+
export * from "./SortItem";
|
|
38
|
+
export * from "./StringOperation";
|
|
39
|
+
export * from "./TimeOperation";
|
|
40
|
+
export * from "./URLOperation";
|
|
40
41
|
export * from "./VersionOperation";
|