@carecard/common-util 2.0.1 → 2.0.2
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/lib/appErrorHandlers.js +105 -72
- package/package.json +1 -1
- package/coverage/clover.xml +0 -90
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/appErrorHandlers.ts.html +0 -802
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/index.ts.html +0 -94
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/responseStatus.ts.html +0 -301
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/utilityFunctions.ts.html +0 -187
- package/coverage/lcov.info +0 -194
- package/dist/cjs/appErrorHandlers.cjs +0 -179
- package/dist/cjs/appErrorHandlers.d.ts +0 -128
- package/dist/cjs/index.cjs +0 -19
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/responseStatus.cjs +0 -71
- package/dist/cjs/responseStatus.d.ts +0 -65
- package/dist/cjs/utilityFunctions.cjs +0 -30
- package/dist/cjs/utilityFunctions.d.ts +0 -9
- package/dist/esm/appErrorHandlers.d.ts +0 -128
- package/dist/esm/appErrorHandlers.js +0 -156
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +0 -3
- package/dist/esm/responseStatus.d.ts +0 -65
- package/dist/esm/responseStatus.js +0 -66
- package/dist/esm/utilityFunctions.d.ts +0 -9
- package/dist/esm/utilityFunctions.js +0 -27
package/lib/appErrorHandlers.js
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* These should be use in app.js file, not in controller files.
|
|
5
5
|
*/
|
|
6
6
|
module.exports = {
|
|
7
|
+
throwAccountSuspendedError,
|
|
8
|
+
throwAccountBlockedError,
|
|
9
|
+
throwAccountInactiveError,
|
|
7
10
|
notFound404,
|
|
8
11
|
appErrorHandler,
|
|
9
12
|
throwValidationFailureError,
|
|
@@ -25,10 +28,10 @@ module.exports = {
|
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
|
|
28
|
-
function notFound404(
|
|
29
|
-
res.status(
|
|
31
|
+
function notFound404(req, res, next) {
|
|
32
|
+
res.status(404);
|
|
30
33
|
const response = {
|
|
31
|
-
error:
|
|
34
|
+
error:
|
|
32
35
|
{
|
|
33
36
|
code: 'NOT_FOUND',
|
|
34
37
|
message: 'Not found',
|
|
@@ -36,13 +39,13 @@ function notFound404( req, res, next ) {
|
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
res.send(
|
|
42
|
+
res.send(response)
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
function appErrorHandler(
|
|
43
|
-
const response =
|
|
45
|
+
function appErrorHandler(err, req, res, next) {
|
|
46
|
+
const response =
|
|
44
47
|
{
|
|
45
|
-
error:
|
|
48
|
+
error:
|
|
46
49
|
{
|
|
47
50
|
code: err.code ?? null,
|
|
48
51
|
message: err.userMessage ?? null,
|
|
@@ -50,213 +53,243 @@ function appErrorHandler( err, req, res, next ) {
|
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
|
|
53
|
-
switch (
|
|
56
|
+
switch (err?.message) {
|
|
57
|
+
|
|
58
|
+
case "Account_Suspended":
|
|
59
|
+
case "Account_Blocked":
|
|
60
|
+
case "Account_Inactive":
|
|
61
|
+
res.status(403);
|
|
62
|
+
res.send(response)
|
|
63
|
+
break;
|
|
54
64
|
|
|
55
65
|
case "Validation_Failure":
|
|
56
|
-
res.status(
|
|
57
|
-
res.send(
|
|
66
|
+
res.status(401);
|
|
67
|
+
res.send(response)
|
|
58
68
|
break;
|
|
59
69
|
|
|
60
70
|
case "Used_Token":
|
|
61
71
|
case "Wrong_Credentials":
|
|
62
|
-
res.status(
|
|
63
|
-
res.send(
|
|
72
|
+
res.status(401);
|
|
73
|
+
res.send(response)
|
|
64
74
|
break;
|
|
65
75
|
|
|
66
76
|
case "Bad_Visitor_Token":
|
|
67
|
-
res.status(
|
|
68
|
-
res.send(
|
|
77
|
+
res.status(401);
|
|
78
|
+
res.send(response)
|
|
69
79
|
break;
|
|
70
80
|
|
|
71
81
|
case "Record_NotSaved":
|
|
72
|
-
res.status(
|
|
73
|
-
res.send(
|
|
82
|
+
res.status(400);
|
|
83
|
+
res.send(response)
|
|
74
84
|
break;
|
|
75
85
|
|
|
76
86
|
case "Record_Exist":
|
|
77
|
-
res.status(
|
|
78
|
-
res.send(
|
|
87
|
+
res.status(409);
|
|
88
|
+
res.send(response)
|
|
79
89
|
break;
|
|
80
90
|
|
|
81
91
|
case "Record_NotFound":
|
|
82
|
-
res.status(
|
|
83
|
-
res.send(
|
|
92
|
+
res.status(404);
|
|
93
|
+
res.send(response)
|
|
84
94
|
break;
|
|
85
95
|
|
|
86
96
|
case "Update_Failed":
|
|
87
|
-
res.status(
|
|
88
|
-
res.send(
|
|
97
|
+
res.status(400);
|
|
98
|
+
res.send(response)
|
|
89
99
|
break;
|
|
90
100
|
|
|
91
101
|
case "Login_Required":
|
|
92
|
-
res.status(
|
|
93
|
-
res.send(
|
|
102
|
+
res.status(401);
|
|
103
|
+
res.send(response)
|
|
94
104
|
break;
|
|
95
105
|
|
|
96
106
|
case "Transaction_Failed":
|
|
97
|
-
res.status(
|
|
98
|
-
res.send(
|
|
107
|
+
res.status(400);
|
|
108
|
+
res.send(response)
|
|
99
109
|
break;
|
|
100
110
|
|
|
101
111
|
case "File_Format_Not_Supported":
|
|
102
|
-
res.status(
|
|
103
|
-
res.send(
|
|
112
|
+
res.status(415);
|
|
113
|
+
res.send(response)
|
|
104
114
|
break;
|
|
105
115
|
|
|
106
116
|
case "Not_Authorized":
|
|
107
|
-
res.status(
|
|
108
|
-
res.send(
|
|
117
|
+
res.status(401);
|
|
118
|
+
res.send(response)
|
|
109
119
|
break;
|
|
110
120
|
|
|
111
121
|
case "Bad_Input":
|
|
112
|
-
res.status(
|
|
113
|
-
res.send(
|
|
122
|
+
res.status(400);
|
|
123
|
+
res.send(response);
|
|
114
124
|
break;
|
|
115
125
|
|
|
116
126
|
case "Input_Not_Uuid" :
|
|
117
|
-
res.status(
|
|
118
|
-
res.send(
|
|
127
|
+
res.status(400);
|
|
128
|
+
res.send(response)
|
|
119
129
|
break;
|
|
120
130
|
|
|
121
131
|
case "File too large":
|
|
122
|
-
res.status(
|
|
123
|
-
res.send(
|
|
132
|
+
res.status(413);
|
|
133
|
+
res.send(response)
|
|
124
134
|
break;
|
|
125
135
|
|
|
126
136
|
case "Invalid time value":
|
|
127
|
-
res.status(
|
|
128
|
-
res.send(
|
|
137
|
+
res.status(403);
|
|
138
|
+
res.send(response)
|
|
129
139
|
break;
|
|
130
140
|
|
|
131
141
|
default:
|
|
132
|
-
res.status(
|
|
133
|
-
res.send(
|
|
142
|
+
res.status(500);
|
|
143
|
+
res.send(response)
|
|
134
144
|
}
|
|
135
145
|
}
|
|
136
146
|
|
|
147
|
+
function throwAccountSuspendedError(params = {}) {
|
|
148
|
+
const error = new Error("Account_Suspended");
|
|
149
|
+
error.code = "ACCOUNT_SUSPENDED";
|
|
150
|
+
error.userMessage = params.userMessage ?? null;
|
|
151
|
+
error.details = params.details ?? null;
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function throwAccountBlockedError(params = {}) {
|
|
156
|
+
const error = new Error("Account_Blocked");
|
|
157
|
+
error.code = "ACCOUNT_BLOCKED";
|
|
158
|
+
error.userMessage = params.userMessage ?? null;
|
|
159
|
+
error.details = params.details ?? null;
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function throwAccountInactiveError(params = {}) {
|
|
164
|
+
const error = new Error("Account_Inactive");
|
|
165
|
+
error.code = "ACCOUNT_INACTIVE";
|
|
166
|
+
error.userMessage = params.userMessage ?? null;
|
|
167
|
+
error.details = params.details ?? null;
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
137
170
|
|
|
138
|
-
function throwValidationFailureError(params={}) {
|
|
139
|
-
const error = new Error(
|
|
171
|
+
function throwValidationFailureError(params = {}) {
|
|
172
|
+
const error = new Error("Validation_Failure");
|
|
140
173
|
error.code = "VALIDATION_FAILURE";
|
|
141
174
|
error.userMessage = params.userMessage ?? null;
|
|
142
175
|
error.details = params.details ?? null;
|
|
143
176
|
throw error;
|
|
144
177
|
}
|
|
145
178
|
|
|
146
|
-
function throwWrongCredentialsError(params={}) {
|
|
147
|
-
const error = new Error(
|
|
179
|
+
function throwWrongCredentialsError(params = {}) {
|
|
180
|
+
const error = new Error("Wrong_Credentials");
|
|
148
181
|
error.code = "WRONG_CREDENTIALS";
|
|
149
182
|
error.userMessage = params.userMessage ?? null;
|
|
150
183
|
error.details = params.details ?? null;
|
|
151
184
|
throw error;
|
|
152
185
|
}
|
|
153
186
|
|
|
154
|
-
function throwRecordExistError(params={}) {
|
|
155
|
-
const error = new Error(
|
|
187
|
+
function throwRecordExistError(params = {}) {
|
|
188
|
+
const error = new Error("Record_Exist");
|
|
156
189
|
error.code = "RECORD_EXIST";
|
|
157
190
|
error.userMessage = params.userMessage ?? null;
|
|
158
191
|
error.details = params.details ?? null;
|
|
159
192
|
throw error;
|
|
160
193
|
}
|
|
161
194
|
|
|
162
|
-
function throwRecordNotFoundError(params={}) {
|
|
163
|
-
const error = new Error(
|
|
195
|
+
function throwRecordNotFoundError(params = {}) {
|
|
196
|
+
const error = new Error("Record_NotFound");
|
|
164
197
|
error.code = "RECORD_NOT_FOUND";
|
|
165
198
|
error.userMessage = params.userMessage ?? null;
|
|
166
199
|
error.details = params.details ?? null;
|
|
167
200
|
throw error;
|
|
168
201
|
}
|
|
169
202
|
|
|
170
|
-
function throwRecordNotSavedError(params={}) {
|
|
171
|
-
const error = new Error(
|
|
203
|
+
function throwRecordNotSavedError(params = {}) {
|
|
204
|
+
const error = new Error("Record_NotSaved");
|
|
172
205
|
error.code = "RECORD_NOT_SAVED";
|
|
173
206
|
error.userMessage = params.userMessage ?? null;
|
|
174
207
|
error.details = params.details ?? null;
|
|
175
208
|
throw error;
|
|
176
209
|
}
|
|
177
210
|
|
|
178
|
-
function throwLoginRequiredError(params={}) {
|
|
179
|
-
const error = new Error(
|
|
211
|
+
function throwLoginRequiredError(params = {}) {
|
|
212
|
+
const error = new Error("Login_Required");
|
|
180
213
|
error.code = "LOGIN_REQUIRED";
|
|
181
214
|
error.userMessage = params.userMessage ?? null;
|
|
182
215
|
error.details = params.details ?? null;
|
|
183
216
|
throw error;
|
|
184
217
|
}
|
|
185
218
|
|
|
186
|
-
function throwUpdateFailedError(params={}) {
|
|
187
|
-
const error = new Error(
|
|
219
|
+
function throwUpdateFailedError(params = {}) {
|
|
220
|
+
const error = new Error("Update_Failed");
|
|
188
221
|
error.code = "UPDATE_FAILED";
|
|
189
222
|
error.userMessage = params.userMessage ?? null;
|
|
190
223
|
error.details = params.details ?? null;
|
|
191
224
|
throw error;
|
|
192
225
|
}
|
|
193
226
|
|
|
194
|
-
function throwTransactionFailedError(params={}) {
|
|
195
|
-
const error = new Error(
|
|
227
|
+
function throwTransactionFailedError(params = {}) {
|
|
228
|
+
const error = new Error("Transaction_Failed");
|
|
196
229
|
error.code = "TRANSACTION_FAILED";
|
|
197
230
|
error.userMessage = params.userMessage ?? null;
|
|
198
231
|
error.details = params.details ?? null;
|
|
199
232
|
throw error;
|
|
200
233
|
}
|
|
201
234
|
|
|
202
|
-
function throwUsedTokenError(params={}) {
|
|
203
|
-
const error = new Error(
|
|
235
|
+
function throwUsedTokenError(params = {}) {
|
|
236
|
+
const error = new Error("Used_Token");
|
|
204
237
|
error.code = "USED_TOKEN";
|
|
205
238
|
error.userMessage = params.userMessage ?? null;
|
|
206
239
|
error.details = params.details ?? null;
|
|
207
240
|
throw error;
|
|
208
241
|
}
|
|
209
242
|
|
|
210
|
-
function throwVisitorTokenError(params={}) {
|
|
211
|
-
const error = new Error(
|
|
243
|
+
function throwVisitorTokenError(params = {}) {
|
|
244
|
+
const error = new Error("Bad_Visitor_Token");
|
|
212
245
|
error.code = "BAD_VISITOR_TOKEN";
|
|
213
246
|
error.userMessage = params.userMessage ?? null;
|
|
214
247
|
error.details = params.details ?? null;
|
|
215
248
|
throw error;
|
|
216
249
|
}
|
|
217
250
|
|
|
218
|
-
function throwFileFormatNotSupportedError(params={}) {
|
|
219
|
-
const error = new Error(
|
|
251
|
+
function throwFileFormatNotSupportedError(params = {}) {
|
|
252
|
+
const error = new Error("File_Format_Not_Supported");
|
|
220
253
|
error.code = "FILE_FORMAT_NOT_SUPPORTED";
|
|
221
254
|
error.userMessage = params.userMessage ?? null;
|
|
222
255
|
error.details = params.details ?? null;
|
|
223
256
|
throw error;
|
|
224
257
|
}
|
|
225
258
|
|
|
226
|
-
function throwNotAuthorizedError(params={}) {
|
|
227
|
-
const error = new Error(
|
|
259
|
+
function throwNotAuthorizedError(params = {}) {
|
|
260
|
+
const error = new Error("Not_Authorized");
|
|
228
261
|
error.code = "NOT_AUTHORIZED";
|
|
229
262
|
error.userMessage = params.userMessage ?? null;
|
|
230
263
|
error.details = params.details ?? null;
|
|
231
264
|
throw error;
|
|
232
265
|
}
|
|
233
266
|
|
|
234
|
-
function throwBadInputError(params={}) {
|
|
235
|
-
const error = new Error(
|
|
267
|
+
function throwBadInputError(params = {}) {
|
|
268
|
+
const error = new Error("Bad_Input");
|
|
236
269
|
error.code = "BAD_INPUT";
|
|
237
270
|
error.userMessage = params.userMessage ?? null;
|
|
238
271
|
error.details = params.details ?? null;
|
|
239
272
|
throw error;
|
|
240
273
|
}
|
|
241
274
|
|
|
242
|
-
function throwInputNotUuidError(params={}) {
|
|
243
|
-
const error = new Error(
|
|
275
|
+
function throwInputNotUuidError(params = {}) {
|
|
276
|
+
const error = new Error("Input_Not_Uuid");
|
|
244
277
|
error.code = "INPUT_NOT_UUID";
|
|
245
278
|
error.userMessage = params.userMessage ?? null;
|
|
246
279
|
error.details = params.details ?? null;
|
|
247
280
|
throw error;
|
|
248
281
|
}
|
|
249
282
|
|
|
250
|
-
function throwFileTooLargeError(params={}) {
|
|
251
|
-
const error = new Error(
|
|
283
|
+
function throwFileTooLargeError(params = {}) {
|
|
284
|
+
const error = new Error("File too large");
|
|
252
285
|
error.code = "FILE_TOO_LARGE";
|
|
253
286
|
error.userMessage = params.userMessage ?? null;
|
|
254
287
|
error.details = params.details ?? null;
|
|
255
288
|
throw error;
|
|
256
289
|
}
|
|
257
290
|
|
|
258
|
-
function throwInvalidTimeValueError(params={}) {
|
|
259
|
-
const error = new Error(
|
|
291
|
+
function throwInvalidTimeValueError(params = {}) {
|
|
292
|
+
const error = new Error("Invalid time value");
|
|
260
293
|
error.code = "INVALID_TIME_VALUE";
|
|
261
294
|
error.userMessage = params.userMessage ?? null;
|
|
262
295
|
error.details = params.details ?? null;
|
package/package.json
CHANGED
package/coverage/clover.xml
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1766541018323" clover="3.2.0">
|
|
3
|
-
<project timestamp="1766541018323" name="All files">
|
|
4
|
-
<metrics statements="72" coveredstatements="70" conditionals="38" coveredconditionals="30" methods="24" coveredmethods="23" elements="134" coveredelements="123" complexity="0" loc="72" ncloc="72" packages="1" files="4" classes="4"/>
|
|
5
|
-
<file name="appErrorHandlers.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/appErrorHandlers.ts">
|
|
6
|
-
<metrics statements="50" coveredstatements="49" conditionals="34" coveredconditionals="28" methods="20" coveredmethods="19"/>
|
|
7
|
-
<line num="30" count="3" type="stmt"/>
|
|
8
|
-
<line num="36" count="16" type="stmt"/>
|
|
9
|
-
<line num="37" count="16" type="stmt"/>
|
|
10
|
-
<line num="38" count="16" type="stmt"/>
|
|
11
|
-
<line num="39" count="16" type="cond" truecount="2" falsecount="0"/>
|
|
12
|
-
<line num="40" count="16" type="cond" truecount="2" falsecount="0"/>
|
|
13
|
-
<line num="48" count="3" type="stmt"/>
|
|
14
|
-
<line num="140" count="3" type="cond" truecount="0" falsecount="1"/>
|
|
15
|
-
<line num="141" count="16" type="stmt"/>
|
|
16
|
-
<line num="142" count="16" type="stmt"/>
|
|
17
|
-
<line num="149" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
18
|
-
<line num="150" count="1" type="stmt"/>
|
|
19
|
-
<line num="152" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
20
|
-
<line num="153" count="1" type="stmt"/>
|
|
21
|
-
<line num="155" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
22
|
-
<line num="157" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
23
|
-
<line num="158" count="1" type="stmt"/>
|
|
24
|
-
<line num="160" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
25
|
-
<line num="161" count="1" type="stmt"/>
|
|
26
|
-
<line num="163" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
27
|
-
<line num="164" count="1" type="stmt"/>
|
|
28
|
-
<line num="166" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
29
|
-
<line num="168" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
30
|
-
<line num="169" count="1" type="stmt"/>
|
|
31
|
-
<line num="171" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
32
|
-
<line num="173" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
33
|
-
<line num="174" count="1" type="stmt"/>
|
|
34
|
-
<line num="176" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
35
|
-
<line num="177" count="1" type="stmt"/>
|
|
36
|
-
<line num="179" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
37
|
-
<line num="180" count="1" type="stmt"/>
|
|
38
|
-
<line num="182" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
39
|
-
<line num="184" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
40
|
-
<line num="185" count="1" type="stmt"/>
|
|
41
|
-
<line num="187" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
42
|
-
<line num="188" count="1" type="stmt"/>
|
|
43
|
-
<line num="190" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
44
|
-
<line num="191" count="1" type="stmt"/>
|
|
45
|
-
<line num="197" count="3" type="stmt"/>
|
|
46
|
-
<line num="198" count="0" type="stmt"/>
|
|
47
|
-
<line num="207" count="3" type="stmt"/>
|
|
48
|
-
<line num="219" count="16" type="stmt"/>
|
|
49
|
-
<line num="221" count="16" type="stmt"/>
|
|
50
|
-
<line num="222" count="16" type="stmt"/>
|
|
51
|
-
<line num="223" count="136" type="stmt"/>
|
|
52
|
-
<line num="224" count="136" type="cond" truecount="2" falsecount="0"/>
|
|
53
|
-
<line num="225" count="16" type="stmt"/>
|
|
54
|
-
<line num="226" count="16" type="stmt"/>
|
|
55
|
-
<line num="230" count="16" type="cond" truecount="1" falsecount="1"/>
|
|
56
|
-
<line num="232" count="16" type="stmt"/>
|
|
57
|
-
</file>
|
|
58
|
-
<file name="index.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/index.ts">
|
|
59
|
-
<metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
60
|
-
<line num="1" count="3" type="stmt"/>
|
|
61
|
-
<line num="2" count="3" type="stmt"/>
|
|
62
|
-
<line num="3" count="3" type="stmt"/>
|
|
63
|
-
</file>
|
|
64
|
-
<file name="responseStatus.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/responseStatus.ts">
|
|
65
|
-
<metrics statements="10" coveredstatements="10" conditionals="0" coveredconditionals="0" methods="3" coveredmethods="3"/>
|
|
66
|
-
<line num="29" count="3" type="stmt"/>
|
|
67
|
-
<line num="33" count="1" type="stmt"/>
|
|
68
|
-
<line num="34" count="1" type="stmt"/>
|
|
69
|
-
<line num="36" count="1" type="stmt"/>
|
|
70
|
-
<line num="55" count="3" type="stmt"/>
|
|
71
|
-
<line num="56" count="1" type="stmt"/>
|
|
72
|
-
<line num="57" count="1" type="stmt"/>
|
|
73
|
-
<line num="69" count="3" type="stmt"/>
|
|
74
|
-
<line num="70" count="1" type="stmt"/>
|
|
75
|
-
<line num="71" count="1" type="stmt"/>
|
|
76
|
-
</file>
|
|
77
|
-
<file name="utilityFunctions.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/utilityFunctions.ts">
|
|
78
|
-
<metrics statements="9" coveredstatements="8" conditionals="4" coveredconditionals="2" methods="1" coveredmethods="1"/>
|
|
79
|
-
<line num="11" count="3" type="stmt"/>
|
|
80
|
-
<line num="16" count="1" type="stmt"/>
|
|
81
|
-
<line num="19" count="1" type="cond" truecount="1" falsecount="1"/>
|
|
82
|
-
<line num="20" count="0" type="stmt"/>
|
|
83
|
-
<line num="24" count="1" type="stmt"/>
|
|
84
|
-
<line num="25" count="2" type="stmt"/>
|
|
85
|
-
<line num="27" count="2" type="cond" truecount="1" falsecount="1"/>
|
|
86
|
-
<line num="29" count="2" type="stmt"/>
|
|
87
|
-
<line num="33" count="1" type="stmt"/>
|
|
88
|
-
</file>
|
|
89
|
-
</project>
|
|
90
|
-
</coverage>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/appErrorHandlers.ts": {"path":"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/appErrorHandlers.ts","statementMap":{"0":{"start":{"line":140,"column":0},"end":{"line":140,"column":16}},"1":{"start":{"line":197,"column":0},"end":{"line":197,"column":16}},"2":{"start":{"line":207,"column":0},"end":{"line":207,"column":16}},"3":{"start":{"line":36,"column":4},"end":{"line":36,"column":19}},"4":{"start":{"line":37,"column":4},"end":{"line":37,"column":27}},"5":{"start":{"line":38,"column":4},"end":{"line":38,"column":21}},"6":{"start":{"line":39,"column":4},"end":{"line":39,"column":50}},"7":{"start":{"line":40,"column":4},"end":{"line":40,"column":42}},"8":{"start":{"line":30,"column":0},"end":{"line":30,"column":13}},"9":{"start":{"line":48,"column":13},"end":{"line":132,"column":11}},"10":{"start":{"line":141,"column":28},"end":{"line":141,"column":45}},"11":{"start":{"line":142,"column":2},"end":{"line":142,"column":44}},"12":{"start":{"line":149,"column":43},"end":{"line":150,"column":40}},"13":{"start":{"line":150,"column":2},"end":{"line":150,"column":40}},"14":{"start":{"line":149,"column":13},"end":{"line":149,"column":43}},"15":{"start":{"line":152,"column":42},"end":{"line":153,"column":39}},"16":{"start":{"line":153,"column":2},"end":{"line":153,"column":39}},"17":{"start":{"line":152,"column":13},"end":{"line":152,"column":42}},"18":{"start":{"line":155,"column":37},"end":{"line":155,"column":97}},"19":{"start":{"line":155,"column":65},"end":{"line":155,"column":97}},"20":{"start":{"line":155,"column":13},"end":{"line":155,"column":37}},"21":{"start":{"line":157,"column":40},"end":{"line":158,"column":38}},"22":{"start":{"line":158,"column":2},"end":{"line":158,"column":38}},"23":{"start":{"line":157,"column":13},"end":{"line":157,"column":40}},"24":{"start":{"line":160,"column":40},"end":{"line":161,"column":38}},"25":{"start":{"line":161,"column":2},"end":{"line":161,"column":38}},"26":{"start":{"line":160,"column":13},"end":{"line":160,"column":40}},"27":{"start":{"line":163,"column":39},"end":{"line":164,"column":36}},"28":{"start":{"line":164,"column":2},"end":{"line":164,"column":36}},"29":{"start":{"line":163,"column":13},"end":{"line":163,"column":39}},"30":{"start":{"line":166,"column":38},"end":{"line":166,"column":99}},"31":{"start":{"line":166,"column":66},"end":{"line":166,"column":99}},"32":{"start":{"line":166,"column":13},"end":{"line":166,"column":38}},"33":{"start":{"line":168,"column":43},"end":{"line":169,"column":40}},"34":{"start":{"line":169,"column":2},"end":{"line":169,"column":40}},"35":{"start":{"line":168,"column":13},"end":{"line":168,"column":43}},"36":{"start":{"line":171,"column":35},"end":{"line":171,"column":93}},"37":{"start":{"line":171,"column":63},"end":{"line":171,"column":93}},"38":{"start":{"line":171,"column":13},"end":{"line":171,"column":35}},"39":{"start":{"line":173,"column":41},"end":{"line":174,"column":39}},"40":{"start":{"line":174,"column":2},"end":{"line":174,"column":39}},"41":{"start":{"line":173,"column":13},"end":{"line":173,"column":41}},"42":{"start":{"line":176,"column":48},"end":{"line":177,"column":47}},"43":{"start":{"line":177,"column":2},"end":{"line":177,"column":47}},"44":{"start":{"line":176,"column":13},"end":{"line":176,"column":48}},"45":{"start":{"line":179,"column":39},"end":{"line":180,"column":36}},"46":{"start":{"line":180,"column":2},"end":{"line":180,"column":36}},"47":{"start":{"line":179,"column":13},"end":{"line":179,"column":39}},"48":{"start":{"line":182,"column":34},"end":{"line":182,"column":91}},"49":{"start":{"line":182,"column":62},"end":{"line":182,"column":91}},"50":{"start":{"line":182,"column":13},"end":{"line":182,"column":34}},"51":{"start":{"line":184,"column":38},"end":{"line":185,"column":36}},"52":{"start":{"line":185,"column":2},"end":{"line":185,"column":36}},"53":{"start":{"line":184,"column":13},"end":{"line":184,"column":38}},"54":{"start":{"line":187,"column":38},"end":{"line":188,"column":36}},"55":{"start":{"line":188,"column":2},"end":{"line":188,"column":36}},"56":{"start":{"line":187,"column":13},"end":{"line":187,"column":38}},"57":{"start":{"line":190,"column":42},"end":{"line":191,"column":40}},"58":{"start":{"line":191,"column":2},"end":{"line":191,"column":40}},"59":{"start":{"line":190,"column":13},"end":{"line":190,"column":42}},"60":{"start":{"line":198,"column":2},"end":{"line":204,"column":5}},"61":{"start":{"line":219,"column":41},"end":{"line":219,"column":50}},"62":{"start":{"line":221,"column":15},"end":{"line":221,"column":74}},"63":{"start":{"line":222,"column":2},"end":{"line":228,"column":3}},"64":{"start":{"line":223,"column":22},"end":{"line":223,"column":38}},"65":{"start":{"line":224,"column":4},"end":{"line":227,"column":5}},"66":{"start":{"line":225,"column":6},"end":{"line":225,"column":28}},"67":{"start":{"line":226,"column":6},"end":{"line":226,"column":12}},"68":{"start":{"line":230,"column":17},"end":{"line":230,"column":41}},"69":{"start":{"line":232,"column":2},"end":{"line":238,"column":5}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":35,"column":2},"end":{"line":35,"column":14}},"loc":{"start":{"line":35,"column":72},"end":{"line":41,"column":3}}},"1":{"name":"throwAppError","decl":{"start":{"line":140,"column":16},"end":{"line":140,"column":29}},"loc":{"start":{"line":140,"column":77},"end":{"line":143,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":149,"column":43},"end":{"line":149,"column":44}},"loc":{"start":{"line":150,"column":2},"end":{"line":150,"column":40}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":152,"column":42},"end":{"line":152,"column":43}},"loc":{"start":{"line":153,"column":2},"end":{"line":153,"column":39}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":155,"column":37},"end":{"line":155,"column":38}},"loc":{"start":{"line":155,"column":65},"end":{"line":155,"column":97}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":157,"column":40},"end":{"line":157,"column":41}},"loc":{"start":{"line":158,"column":2},"end":{"line":158,"column":38}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":160,"column":40},"end":{"line":160,"column":41}},"loc":{"start":{"line":161,"column":2},"end":{"line":161,"column":38}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":163,"column":39},"end":{"line":163,"column":40}},"loc":{"start":{"line":164,"column":2},"end":{"line":164,"column":36}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":166,"column":38},"end":{"line":166,"column":39}},"loc":{"start":{"line":166,"column":66},"end":{"line":166,"column":99}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":168,"column":43},"end":{"line":168,"column":44}},"loc":{"start":{"line":169,"column":2},"end":{"line":169,"column":40}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":171,"column":35},"end":{"line":171,"column":36}},"loc":{"start":{"line":171,"column":63},"end":{"line":171,"column":93}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":173,"column":41},"end":{"line":173,"column":42}},"loc":{"start":{"line":174,"column":2},"end":{"line":174,"column":39}}},"12":{"name":"(anonymous_12)","decl":{"start":{"line":176,"column":48},"end":{"line":176,"column":49}},"loc":{"start":{"line":177,"column":2},"end":{"line":177,"column":47}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":179,"column":39},"end":{"line":179,"column":40}},"loc":{"start":{"line":180,"column":2},"end":{"line":180,"column":36}}},"14":{"name":"(anonymous_14)","decl":{"start":{"line":182,"column":34},"end":{"line":182,"column":35}},"loc":{"start":{"line":182,"column":62},"end":{"line":182,"column":91}}},"15":{"name":"(anonymous_15)","decl":{"start":{"line":184,"column":38},"end":{"line":184,"column":39}},"loc":{"start":{"line":185,"column":2},"end":{"line":185,"column":36}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":187,"column":38},"end":{"line":187,"column":39}},"loc":{"start":{"line":188,"column":2},"end":{"line":188,"column":36}}},"17":{"name":"(anonymous_17)","decl":{"start":{"line":190,"column":42},"end":{"line":190,"column":43}},"loc":{"start":{"line":191,"column":2},"end":{"line":191,"column":40}}},"18":{"name":"notFound404","decl":{"start":{"line":197,"column":16},"end":{"line":197,"column":27}},"loc":{"start":{"line":197,"column":76},"end":{"line":205,"column":1}}},"19":{"name":"appErrorHandler","decl":{"start":{"line":207,"column":16},"end":{"line":207,"column":31}},"loc":{"start":{"line":216,"column":21},"end":{"line":239,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":35,"column":45},"end":{"line":35,"column":72}},"type":"default-arg","locations":[{"start":{"line":35,"column":70},"end":{"line":35,"column":72}}]},"1":{"loc":{"start":{"line":39,"column":23},"end":{"line":39,"column":49}},"type":"binary-expr","locations":[{"start":{"line":39,"column":23},"end":{"line":39,"column":41}},{"start":{"line":39,"column":45},"end":{"line":39,"column":49}}]},"2":{"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":41}},"type":"binary-expr","locations":[{"start":{"line":40,"column":19},"end":{"line":40,"column":33}},{"start":{"line":40,"column":37},"end":{"line":40,"column":41}}]},"3":{"loc":{"start":{"line":140,"column":50},"end":{"line":140,"column":77}},"type":"default-arg","locations":[{"start":{"line":140,"column":75},"end":{"line":140,"column":77}}]},"4":{"loc":{"start":{"line":149,"column":44},"end":{"line":149,"column":66}},"type":"default-arg","locations":[{"start":{"line":149,"column":64},"end":{"line":149,"column":66}}]},"5":{"loc":{"start":{"line":152,"column":43},"end":{"line":152,"column":65}},"type":"default-arg","locations":[{"start":{"line":152,"column":63},"end":{"line":152,"column":65}}]},"6":{"loc":{"start":{"line":155,"column":38},"end":{"line":155,"column":60}},"type":"default-arg","locations":[{"start":{"line":155,"column":58},"end":{"line":155,"column":60}}]},"7":{"loc":{"start":{"line":157,"column":41},"end":{"line":157,"column":63}},"type":"default-arg","locations":[{"start":{"line":157,"column":61},"end":{"line":157,"column":63}}]},"8":{"loc":{"start":{"line":160,"column":41},"end":{"line":160,"column":63}},"type":"default-arg","locations":[{"start":{"line":160,"column":61},"end":{"line":160,"column":63}}]},"9":{"loc":{"start":{"line":163,"column":40},"end":{"line":163,"column":62}},"type":"default-arg","locations":[{"start":{"line":163,"column":60},"end":{"line":163,"column":62}}]},"10":{"loc":{"start":{"line":166,"column":39},"end":{"line":166,"column":61}},"type":"default-arg","locations":[{"start":{"line":166,"column":59},"end":{"line":166,"column":61}}]},"11":{"loc":{"start":{"line":168,"column":44},"end":{"line":168,"column":66}},"type":"default-arg","locations":[{"start":{"line":168,"column":64},"end":{"line":168,"column":66}}]},"12":{"loc":{"start":{"line":171,"column":36},"end":{"line":171,"column":58}},"type":"default-arg","locations":[{"start":{"line":171,"column":56},"end":{"line":171,"column":58}}]},"13":{"loc":{"start":{"line":173,"column":42},"end":{"line":173,"column":64}},"type":"default-arg","locations":[{"start":{"line":173,"column":62},"end":{"line":173,"column":64}}]},"14":{"loc":{"start":{"line":176,"column":49},"end":{"line":176,"column":71}},"type":"default-arg","locations":[{"start":{"line":176,"column":69},"end":{"line":176,"column":71}}]},"15":{"loc":{"start":{"line":179,"column":40},"end":{"line":179,"column":62}},"type":"default-arg","locations":[{"start":{"line":179,"column":60},"end":{"line":179,"column":62}}]},"16":{"loc":{"start":{"line":182,"column":35},"end":{"line":182,"column":57}},"type":"default-arg","locations":[{"start":{"line":182,"column":55},"end":{"line":182,"column":57}}]},"17":{"loc":{"start":{"line":184,"column":39},"end":{"line":184,"column":61}},"type":"default-arg","locations":[{"start":{"line":184,"column":59},"end":{"line":184,"column":61}}]},"18":{"loc":{"start":{"line":187,"column":39},"end":{"line":187,"column":61}},"type":"default-arg","locations":[{"start":{"line":187,"column":59},"end":{"line":187,"column":61}}]},"19":{"loc":{"start":{"line":190,"column":43},"end":{"line":190,"column":65}},"type":"default-arg","locations":[{"start":{"line":190,"column":63},"end":{"line":190,"column":65}}]},"20":{"loc":{"start":{"line":224,"column":4},"end":{"line":227,"column":5}},"type":"if","locations":[{"start":{"line":224,"column":4},"end":{"line":227,"column":5}},{"start":{},"end":{}}]},"21":{"loc":{"start":{"line":230,"column":17},"end":{"line":230,"column":41}},"type":"binary-expr","locations":[{"start":{"line":230,"column":17},"end":{"line":230,"column":34}},{"start":{"line":230,"column":38},"end":{"line":230,"column":41}}]},"22":{"loc":{"start":{"line":234,"column":12},"end":{"line":234,"column":48}},"type":"binary-expr","locations":[{"start":{"line":234,"column":12},"end":{"line":234,"column":21}},{"start":{"line":234,"column":25},"end":{"line":234,"column":40}},{"start":{"line":234,"column":44},"end":{"line":234,"column":48}}]},"23":{"loc":{"start":{"line":235,"column":15},"end":{"line":235,"column":61}},"type":"binary-expr","locations":[{"start":{"line":235,"column":15},"end":{"line":235,"column":31}},{"start":{"line":235,"column":35},"end":{"line":235,"column":53}},{"start":{"line":235,"column":57},"end":{"line":235,"column":61}}]},"24":{"loc":{"start":{"line":236,"column":15},"end":{"line":236,"column":35}},"type":"binary-expr","locations":[{"start":{"line":236,"column":15},"end":{"line":236,"column":27}},{"start":{"line":236,"column":31},"end":{"line":236,"column":35}}]}},"s":{"0":3,"1":3,"2":3,"3":16,"4":16,"5":16,"6":16,"7":16,"8":3,"9":3,"10":16,"11":16,"12":3,"13":1,"14":3,"15":3,"16":1,"17":3,"18":3,"19":1,"20":3,"21":3,"22":1,"23":3,"24":3,"25":1,"26":3,"27":3,"28":1,"29":3,"30":3,"31":1,"32":3,"33":3,"34":1,"35":3,"36":3,"37":1,"38":3,"39":3,"40":1,"41":3,"42":3,"43":1,"44":3,"45":3,"46":1,"47":3,"48":3,"49":1,"50":3,"51":3,"52":1,"53":3,"54":3,"55":1,"56":3,"57":3,"58":1,"59":3,"60":0,"61":16,"62":16,"63":16,"64":136,"65":136,"66":16,"67":16,"68":16,"69":16},"f":{"0":16,"1":16,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":0,"19":16},"b":{"0":[0],"1":[16,16],"2":[16,16],"3":[0],"4":[1],"5":[1],"6":[1],"7":[1],"8":[1],"9":[1],"10":[1],"11":[1],"12":[1],"13":[1],"14":[1],"15":[1],"16":[1],"17":[1],"18":[1],"19":[1],"20":[16,120],"21":[16,0],"22":[16,0,0],"23":[16,16,0],"24":[16,16]}}
|
|
2
|
-
,"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/index.ts": {"path":"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":35}}},"fnMap":{},"branchMap":{},"s":{"0":3,"1":3,"2":3},"f":{},"b":{}}
|
|
3
|
-
,"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/responseStatus.ts": {"path":"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/responseStatus.ts","statementMap":{"0":{"start":{"line":29,"column":0},"end":{"line":29,"column":16}},"1":{"start":{"line":55,"column":0},"end":{"line":55,"column":16}},"2":{"start":{"line":69,"column":0},"end":{"line":69,"column":16}},"3":{"start":{"line":33,"column":2},"end":{"line":33,"column":26}},"4":{"start":{"line":34,"column":2},"end":{"line":34,"column":18}},"5":{"start":{"line":36,"column":2},"end":{"line":36,"column":13}},"6":{"start":{"line":56,"column":2},"end":{"line":56,"column":18}},"7":{"start":{"line":57,"column":2},"end":{"line":57,"column":13}},"8":{"start":{"line":70,"column":2},"end":{"line":70,"column":18}},"9":{"start":{"line":71,"column":2},"end":{"line":71,"column":13}}},"fnMap":{"0":{"name":"setOk200","decl":{"start":{"line":29,"column":16},"end":{"line":29,"column":24}},"loc":{"start":{"line":31,"column":11},"end":{"line":37,"column":1}}},"1":{"name":"setCreated201","decl":{"start":{"line":55,"column":16},"end":{"line":55,"column":29}},"loc":{"start":{"line":55,"column":69},"end":{"line":58,"column":1}}},"2":{"name":"setBadRequest400ClientError","decl":{"start":{"line":69,"column":16},"end":{"line":69,"column":43}},"loc":{"start":{"line":69,"column":83},"end":{"line":72,"column":1}}}},"branchMap":{},"s":{"0":3,"1":3,"2":3,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{"0":1,"1":1,"2":1},"b":{}}
|
|
4
|
-
,"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/utilityFunctions.ts": {"path":"/Users/pankajpriscilla/SO_CareCardCa/pkg-common-util/src/utilityFunctions.ts","statementMap":{"0":{"start":{"line":11,"column":0},"end":{"line":11,"column":16}},"1":{"start":{"line":16,"column":41},"end":{"line":16,"column":43}},"2":{"start":{"line":19,"column":2},"end":{"line":21,"column":3}},"3":{"start":{"line":20,"column":4},"end":{"line":20,"column":21}},"4":{"start":{"line":24,"column":2},"end":{"line":31,"column":3}},"5":{"start":{"line":25,"column":18},"end":{"line":25,"column":37}},"6":{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},"7":{"start":{"line":29,"column":6},"end":{"line":29,"column":48}},"8":{"start":{"line":33,"column":2},"end":{"line":33,"column":19}}},"fnMap":{"0":{"name":"extractObjectWithProperties","decl":{"start":{"line":11,"column":16},"end":{"line":11,"column":43}},"loc":{"start":{"line":13,"column":37},"end":{"line":34,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":2},"end":{"line":21,"column":3}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":21,"column":3}},{"start":{},"end":{}}]},"1":{"loc":{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},{"start":{},"end":{}}]}},"s":{"0":3,"1":1,"2":1,"3":0,"4":1,"5":2,"6":2,"7":2,"8":1},"f":{"0":1},"b":{"0":[0,1],"1":[2,0]}}
|
|
5
|
-
}
|