@verisoft/core 17.0.0 → 17.2.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.
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@verisoft/core",
3
- "version": "17.0.0",
3
+ "version": "17.2.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
7
- "rxjs": "~7.8.0"
7
+ "rxjs": "~7.8.0",
8
+ "moment": "^2.30.1"
8
9
  },
9
10
  "dependencies": {},
10
11
  "sideEffects": false
package/src/index.ts CHANGED
@@ -5,4 +5,6 @@ export * from './lib/models/lazy-load.model';
5
5
  export * from './lib/services/base-http.service';
6
6
 
7
7
  export * from './lib/utils/clear.utils';
8
- export * from './lib/utils/keyOrFn.utils';
8
+ export * from './lib/utils/keyOrFn.utils';
9
+ export * from './lib/utils/array.utils';
10
+ export * from './lib/utils/data.utils';
@@ -101,4 +101,8 @@ export abstract class BaseHttpService<T, TKey = number> {
101
101
  }
102
102
  return null;
103
103
  }
104
+
105
+ private printNevim() {
106
+ console.log("hello world")
107
+ }
104
108
  }
@@ -0,0 +1,9 @@
1
+ type ArrayIntersectionType = (string | number)[]
2
+
3
+ export function isArrayIntersected(
4
+ array1: ArrayIntersectionType,
5
+ array2: ArrayIntersectionType,
6
+ ) {
7
+ const filteredArray = array1.filter(value => array2.includes(value));
8
+ return filteredArray.length > 0;
9
+ }
@@ -0,0 +1,34 @@
1
+ import moment from 'moment';
2
+
3
+ export function transformData(data: any){
4
+ if (data) {
5
+ if (moment.isMoment(data)) {
6
+ return moment(data)
7
+ .toDate()
8
+ .toISOString();
9
+ }
10
+ else if (data instanceof Date) {
11
+ return data.toISOString();
12
+ }
13
+ }
14
+ return data;
15
+ }
16
+
17
+ export function convertToDate(data: any){
18
+ if (data) {
19
+ if (!isNaN(Date.parse(data))) {
20
+ return new Date(data);
21
+ }
22
+ }
23
+ return data;
24
+ }
25
+
26
+ export function convertToDateTime(data: any){
27
+ if (data) {
28
+ if (!isNaN(Date.parse(data))) {
29
+ const date = new Date(data);
30
+ return moment(date).format('DD.MM.yyyy HH:mm');
31
+ }
32
+ }
33
+ return data;
34
+ }