jdev_helpers 1.4.7 → 1.4.8

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/index.d.mts CHANGED
@@ -1,6 +1,9 @@
1
- import { HttpParams, HttpClient } from '@angular/common/http';
1
+ import { HttpClient, HttpParams } from '@angular/common/http';
2
2
 
3
- declare const debug: (message?: any, ...optionalParams: any[]) => void;
3
+ declare abstract class HttpParentService {
4
+ protected readonly http: HttpClient;
5
+ constructor();
6
+ }
4
7
 
5
8
  declare const REQUEST_PARAM_PAGE_NUMBER = "pageNumber";
6
9
  declare const REQUEST_PARAM_QUERY = "query";
@@ -15,10 +18,7 @@ declare const OBSERVE_BODY = "body";
15
18
  declare const HTTP_HEADER_CONTENT_TYPE = "content-type";
16
19
  declare const MIME_TYPE_TEXT_PLAIN = "text/plain";
17
20
 
18
- declare const WRITE_TO_LOCAL_STORAGE: (storageName: string, obj: any) => void;
19
- declare const WRITE_TO_SESSION_STORAGE: (storageName: string, obj: any) => void;
20
- declare const READ_FROM_LOCAL_STORAGE: (storageName: string) => any;
21
- declare const READ_FROM_SESSION_STORAGE: (storageName: string) => any;
21
+ declare const debug: (message?: any, ...optionalParams: any[]) => void;
22
22
 
23
23
  interface CustomHttpParam {
24
24
  key: string;
@@ -28,9 +28,9 @@ interface CustomHttpParam {
28
28
  declare function createHttpParams(customHttpParams: CustomHttpParam[]): HttpParams;
29
29
  declare function addHttpParams(hp: HttpParams, customHttpParams: CustomHttpParam): HttpParams;
30
30
 
31
- declare abstract class HttpParentService {
32
- protected readonly http: HttpClient;
33
- constructor();
34
- }
31
+ declare const WRITE_TO_LOCAL_STORAGE: (storageName: string, obj: any) => void;
32
+ declare const WRITE_TO_SESSION_STORAGE: (storageName: string, obj: any) => void;
33
+ declare const READ_FROM_LOCAL_STORAGE: (storageName: string) => any;
34
+ declare const READ_FROM_SESSION_STORAGE: (storageName: string) => any;
35
35
 
36
36
  export { type CustomHttpParam, HTTP_HEADER_CONTENT_TYPE, HttpParentService, MIME_TYPE_TEXT_PLAIN, OBSERVE_BODY, OBSERVE_RESPONSE, READ_FROM_LOCAL_STORAGE, READ_FROM_SESSION_STORAGE, REQUEST_PARAM_LIMIT, REQUEST_PARAM_LOCALE, REQUEST_PARAM_MATCH_SCORE, REQUEST_PARAM_NEXT_CURSOR, REQUEST_PARAM_PAGE_NUMBER, REQUEST_PARAM_QUERY, REQUEST_PARAM_SIMILARITY, RESPONSE_TYPE_JSON, WRITE_TO_LOCAL_STORAGE, WRITE_TO_SESSION_STORAGE, addHttpParams, createHttpParams, debug };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { HttpParams, HttpClient } from '@angular/common/http';
1
+ import { HttpClient, HttpParams } from '@angular/common/http';
2
2
 
3
- declare const debug: (message?: any, ...optionalParams: any[]) => void;
3
+ declare abstract class HttpParentService {
4
+ protected readonly http: HttpClient;
5
+ constructor();
6
+ }
4
7
 
5
8
  declare const REQUEST_PARAM_PAGE_NUMBER = "pageNumber";
6
9
  declare const REQUEST_PARAM_QUERY = "query";
@@ -15,10 +18,7 @@ declare const OBSERVE_BODY = "body";
15
18
  declare const HTTP_HEADER_CONTENT_TYPE = "content-type";
16
19
  declare const MIME_TYPE_TEXT_PLAIN = "text/plain";
17
20
 
18
- declare const WRITE_TO_LOCAL_STORAGE: (storageName: string, obj: any) => void;
19
- declare const WRITE_TO_SESSION_STORAGE: (storageName: string, obj: any) => void;
20
- declare const READ_FROM_LOCAL_STORAGE: (storageName: string) => any;
21
- declare const READ_FROM_SESSION_STORAGE: (storageName: string) => any;
21
+ declare const debug: (message?: any, ...optionalParams: any[]) => void;
22
22
 
23
23
  interface CustomHttpParam {
24
24
  key: string;
@@ -28,9 +28,9 @@ interface CustomHttpParam {
28
28
  declare function createHttpParams(customHttpParams: CustomHttpParam[]): HttpParams;
29
29
  declare function addHttpParams(hp: HttpParams, customHttpParams: CustomHttpParam): HttpParams;
30
30
 
31
- declare abstract class HttpParentService {
32
- protected readonly http: HttpClient;
33
- constructor();
34
- }
31
+ declare const WRITE_TO_LOCAL_STORAGE: (storageName: string, obj: any) => void;
32
+ declare const WRITE_TO_SESSION_STORAGE: (storageName: string, obj: any) => void;
33
+ declare const READ_FROM_LOCAL_STORAGE: (storageName: string) => any;
34
+ declare const READ_FROM_SESSION_STORAGE: (storageName: string) => any;
35
35
 
36
36
  export { type CustomHttpParam, HTTP_HEADER_CONTENT_TYPE, HttpParentService, MIME_TYPE_TEXT_PLAIN, OBSERVE_BODY, OBSERVE_RESPONSE, READ_FROM_LOCAL_STORAGE, READ_FROM_SESSION_STORAGE, REQUEST_PARAM_LIMIT, REQUEST_PARAM_LOCALE, REQUEST_PARAM_MATCH_SCORE, REQUEST_PARAM_NEXT_CURSOR, REQUEST_PARAM_PAGE_NUMBER, REQUEST_PARAM_QUERY, REQUEST_PARAM_SIMILARITY, RESPONSE_TYPE_JSON, WRITE_TO_LOCAL_STORAGE, WRITE_TO_SESSION_STORAGE, addHttpParams, createHttpParams, debug };
package/dist/index.js CHANGED
@@ -43,9 +43,13 @@ __export(index_exports, {
43
43
  });
44
44
  module.exports = __toCommonJS(index_exports);
45
45
 
46
- // src/js/common-helpers.ts
47
- var debug = (message, ...optionalParams) => {
48
- console.log(message, ...optionalParams);
46
+ // src/angular/http-parent.service.ts
47
+ var import_http = require("@angular/common/http");
48
+ var import_core = require("@angular/core");
49
+ var HttpParentService = class {
50
+ http = (0, import_core.inject)(import_http.HttpClient);
51
+ constructor() {
52
+ }
49
53
  };
50
54
 
51
55
  // src/js/common-constants.ts
@@ -62,6 +66,34 @@ var OBSERVE_BODY = "body";
62
66
  var HTTP_HEADER_CONTENT_TYPE = "content-type";
63
67
  var MIME_TYPE_TEXT_PLAIN = "text/plain";
64
68
 
69
+ // src/js/common-helpers.ts
70
+ var debug = (message, ...optionalParams) => {
71
+ console.log(message, ...optionalParams);
72
+ };
73
+
74
+ // src/js/http-helpers.ts
75
+ var import_http2 = require("@angular/common/http");
76
+ function createHttpParams(customHttpParams) {
77
+ return addParamsToHttpParamsProcess(new import_http2.HttpParams(), customHttpParams);
78
+ }
79
+ function addHttpParams(hp, customHttpParams) {
80
+ if (customHttpParams.needToCheckValue) {
81
+ if (customHttpParams.value === null || customHttpParams.value === void 0) {
82
+ return hp;
83
+ } else {
84
+ return hp.append(customHttpParams.key, customHttpParams.value);
85
+ }
86
+ } else {
87
+ return hp.append(customHttpParams.key, customHttpParams.value);
88
+ }
89
+ }
90
+ function addParamsToHttpParamsProcess(hp, customHttpParams) {
91
+ customHttpParams.forEach((currentCustomHttpParam) => {
92
+ hp = addHttpParams(hp, currentCustomHttpParam);
93
+ });
94
+ return hp;
95
+ }
96
+
65
97
  // src/js/storage-helpers.ts
66
98
  var WRITE_TO_LOCAL_STORAGE = (storageName, obj) => {
67
99
  writeToStorage(storageName, obj, true);
@@ -96,38 +128,6 @@ var writeToStorage = (storageName, obj, isLocalStorage) => {
96
128
  }
97
129
  }
98
130
  };
99
-
100
- // src/js/http-helpers.ts
101
- var import_http = require("@angular/common/http");
102
- function createHttpParams(customHttpParams) {
103
- return addParamsToHttpParamsProcess(new import_http.HttpParams(), customHttpParams);
104
- }
105
- function addHttpParams(hp, customHttpParams) {
106
- if (customHttpParams.needToCheckValue) {
107
- if (customHttpParams.value === null || customHttpParams.value === void 0) {
108
- return hp;
109
- } else {
110
- return hp.append(customHttpParams.key, customHttpParams.value);
111
- }
112
- } else {
113
- return hp.append(customHttpParams.key, customHttpParams.value);
114
- }
115
- }
116
- function addParamsToHttpParamsProcess(hp, customHttpParams) {
117
- customHttpParams.forEach((currentCustomHttpParam) => {
118
- hp = addHttpParams(hp, currentCustomHttpParam);
119
- });
120
- return hp;
121
- }
122
-
123
- // src/angular/http-parent.service.ts
124
- var import_http2 = require("@angular/common/http");
125
- var import_core = require("@angular/core");
126
- var HttpParentService = class {
127
- http = (0, import_core.inject)(import_http2.HttpClient);
128
- constructor() {
129
- }
130
- };
131
131
  // Annotate the CommonJS export names for ESM import in node:
132
132
  0 && (module.exports = {
133
133
  HTTP_HEADER_CONTENT_TYPE,
package/dist/index.mjs CHANGED
@@ -1,6 +1,10 @@
1
- // src/js/common-helpers.ts
2
- var debug = (message, ...optionalParams) => {
3
- console.log(message, ...optionalParams);
1
+ // src/angular/http-parent.service.ts
2
+ import { HttpClient } from "@angular/common/http";
3
+ import { inject } from "@angular/core";
4
+ var HttpParentService = class {
5
+ http = inject(HttpClient);
6
+ constructor() {
7
+ }
4
8
  };
5
9
 
6
10
  // src/js/common-constants.ts
@@ -17,6 +21,34 @@ var OBSERVE_BODY = "body";
17
21
  var HTTP_HEADER_CONTENT_TYPE = "content-type";
18
22
  var MIME_TYPE_TEXT_PLAIN = "text/plain";
19
23
 
24
+ // src/js/common-helpers.ts
25
+ var debug = (message, ...optionalParams) => {
26
+ console.log(message, ...optionalParams);
27
+ };
28
+
29
+ // src/js/http-helpers.ts
30
+ import { HttpParams } from "@angular/common/http";
31
+ function createHttpParams(customHttpParams) {
32
+ return addParamsToHttpParamsProcess(new HttpParams(), customHttpParams);
33
+ }
34
+ function addHttpParams(hp, customHttpParams) {
35
+ if (customHttpParams.needToCheckValue) {
36
+ if (customHttpParams.value === null || customHttpParams.value === void 0) {
37
+ return hp;
38
+ } else {
39
+ return hp.append(customHttpParams.key, customHttpParams.value);
40
+ }
41
+ } else {
42
+ return hp.append(customHttpParams.key, customHttpParams.value);
43
+ }
44
+ }
45
+ function addParamsToHttpParamsProcess(hp, customHttpParams) {
46
+ customHttpParams.forEach((currentCustomHttpParam) => {
47
+ hp = addHttpParams(hp, currentCustomHttpParam);
48
+ });
49
+ return hp;
50
+ }
51
+
20
52
  // src/js/storage-helpers.ts
21
53
  var WRITE_TO_LOCAL_STORAGE = (storageName, obj) => {
22
54
  writeToStorage(storageName, obj, true);
@@ -51,38 +83,6 @@ var writeToStorage = (storageName, obj, isLocalStorage) => {
51
83
  }
52
84
  }
53
85
  };
54
-
55
- // src/js/http-helpers.ts
56
- import { HttpParams } from "@angular/common/http";
57
- function createHttpParams(customHttpParams) {
58
- return addParamsToHttpParamsProcess(new HttpParams(), customHttpParams);
59
- }
60
- function addHttpParams(hp, customHttpParams) {
61
- if (customHttpParams.needToCheckValue) {
62
- if (customHttpParams.value === null || customHttpParams.value === void 0) {
63
- return hp;
64
- } else {
65
- return hp.append(customHttpParams.key, customHttpParams.value);
66
- }
67
- } else {
68
- return hp.append(customHttpParams.key, customHttpParams.value);
69
- }
70
- }
71
- function addParamsToHttpParamsProcess(hp, customHttpParams) {
72
- customHttpParams.forEach((currentCustomHttpParam) => {
73
- hp = addHttpParams(hp, currentCustomHttpParam);
74
- });
75
- return hp;
76
- }
77
-
78
- // src/angular/http-parent.service.ts
79
- import { HttpClient } from "@angular/common/http";
80
- import { inject } from "@angular/core";
81
- var HttpParentService = class {
82
- http = inject(HttpClient);
83
- constructor() {
84
- }
85
- };
86
86
  export {
87
87
  HTTP_HEADER_CONTENT_TYPE,
88
88
  HttpParentService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jdev_helpers",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "jdev helpers for js and angular",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",