drapcode-utility 1.9.3 → 1.9.5

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.
@@ -128,6 +128,7 @@ var handleMultErrorConfig = function (error, result, status) {
128
128
  console.log("handleMultErrorConfig result :>> ".concat(Object.keys(result)));
129
129
  apiErrorMessage = lodash_1.default.get(result, message);
130
130
  if (apiErrorMessage) {
131
+ console.log("*** utility 3 ***");
131
132
  if (typeof apiErrorMessage == "string") {
132
133
  console.log("It's string so leave");
133
134
  }
@@ -144,13 +145,16 @@ var handleMultErrorConfig = function (error, result, status) {
144
145
  apiErrorValue = lodash_1.default.get(result, path);
145
146
  }
146
147
  else {
148
+ console.log("*** utility 7 ***");
147
149
  apiErrorValue = status;
148
150
  }
151
+ console.log("*** utility 8 ***");
149
152
  }
150
153
  else {
151
154
  console.log("result", result);
152
155
  apiErrorValue = status;
153
156
  }
157
+ console.log("apiErrorValue", apiErrorValue);
154
158
  apiErrorValue = "".concat(apiErrorValue);
155
159
  console.log("apiErrorMessage", apiErrorMessage);
156
160
  console.log("apiErrorValue", apiErrorValue);
@@ -161,6 +165,7 @@ var handleMultErrorConfig = function (error, result, status) {
161
165
  };
162
166
  }
163
167
  else if (["false", "error", "fail", "failed"].includes(apiErrorValue.toLowerCase())) {
168
+ console.log("*** utility 9 ***");
164
169
  return {
165
170
  status: 400,
166
171
  message: apiErrorMessage,
@@ -169,6 +174,8 @@ var handleMultErrorConfig = function (error, result, status) {
169
174
  else if (voca_1.default.startsWith(apiErrorValue, "3") ||
170
175
  voca_1.default.startsWith(apiErrorValue, "4") ||
171
176
  voca_1.default.startsWith(apiErrorValue, "5")) {
177
+ console.log("*** utility 10 ***");
178
+ console.log("Compare 4");
172
179
  return {
173
180
  status: apiErrorValue,
174
181
  message: apiErrorMessage,
@@ -73,8 +73,16 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
73
73
  if (!query)
74
74
  return [2 /*return*/, ""];
75
75
  console.log("***1*** queryParser ***");
76
+ console.log("%%%%% refCollectionFieldsInItems", JSON.stringify(refCollectionFieldsInItems));
77
+ console.log("%%%% timezone", timezone);
78
+ console.log("collectionName", collectionName);
79
+ console.log("query", JSON.stringify(query));
80
+ console.log("constants", JSON.stringify(constants));
81
+ console.log("externalParams", JSON.stringify(externalParams));
82
+ console.log("currentUser", JSON.stringify(currentUser));
83
+ console.log("searchObj", JSON.stringify(searchObj));
84
+ console.log("searchQueryTypeObj", JSON.stringify(searchQueryTypeObj));
76
85
  filterQuery = mongoFilterQuery(query, externalParams, constants, currentUser, currentTenant, currentUserSetting, timezone);
77
- console.log("**************************");
78
86
  console.log("filterQuery", JSON.stringify(filterQuery));
79
87
  rlsFilterQuery = [];
80
88
  if (rowLevelSecurityFilter && rowLevelSecurityFilter.conditions.length) {
@@ -92,10 +100,13 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
92
100
  if (searchObj) {
93
101
  _a = getSearchObjQuery(searchObj, searchQueryTypeObj, timezone), searchAggregateQuery = _a.searchAggregateQuery, likeQuery = _a.likeQuery;
94
102
  aggregateQuery = __spreadArray(__spreadArray([], aggregateQuery, true), searchAggregateQuery, true);
103
+ console.log("likeQuery after getSearchObjQuery", JSON.stringify(likeQuery));
95
104
  if (likeQuery && likeQuery.length > 0) {
96
105
  searchQueryObj = likeQuery;
97
106
  }
98
107
  }
108
+ console.log("aggregateQuery After search object condition", JSON.stringify(aggregateQuery));
109
+ console.log("searchQueryObj", JSON.stringify(searchQueryObj));
99
110
  finalQuery = { $and: filterQuery };
100
111
  if (rlsFilterQuery.length &&
101
112
  ((rlsFilterQuery[0].$or && rlsFilterQuery[0].$or.length) ||
@@ -105,15 +116,18 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
105
116
  if (searchQueryObj) {
106
117
  (_d = finalQuery.$and).push.apply(_d, searchQueryObj);
107
118
  }
119
+ console.log("finalQuery after", JSON.stringify(finalQuery));
108
120
  aggregateQuery.push({ $match: finalQuery });
109
121
  }
110
122
  else if (searchObj) {
123
+ console.log("I donot have filter query");
111
124
  _b = getSearchObjQuery(searchObj, searchQueryTypeObj, timezone), searchAggregateQuery = _b.searchAggregateQuery, likeQuery = _b.likeQuery;
112
125
  aggregateQuery = __spreadArray(__spreadArray([], aggregateQuery, true), searchAggregateQuery, true);
113
126
  if (likeQuery.length) {
114
127
  aggregateQuery.push({ $match: { $and: likeQuery } });
115
128
  }
116
129
  }
130
+ console.log("aggregateQuery", JSON.stringify(aggregateQuery));
117
131
  console.log("==> query", query);
118
132
  console.log("lookupConfig", lookupConfig);
119
133
  projection = mongoSelectQuery(query);
@@ -281,10 +295,10 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
281
295
  // if (isDate) fieldValue = new Date(fieldValue);
282
296
  console.log("fieldValue queryToMongo 1", fieldValue);
283
297
  var condition = [
284
- "dynamic_option",
285
- "reference",
286
- "static_option",
287
- "belongsTo",
298
+ drapcode_constant_1.FieldTypes.dynamic_option.id,
299
+ drapcode_constant_1.FieldTypes.reference.id,
300
+ drapcode_constant_1.FieldTypes.static_option.id,
301
+ drapcode_constant_1.FieldTypes.belongsTo.id,
288
302
  ].includes(fieldType);
289
303
  if (condition && key === drapcode_constant_1.EQUALS && !isDate) {
290
304
  if (!Array.isArray(fieldValue)) {
@@ -397,7 +411,7 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
397
411
  }
398
412
  : {};
399
413
  }
400
- if (key == drapcode_constant_1.EQUALS && fieldType === "boolean" && fieldValue)
414
+ if (key == drapcode_constant_1.EQUALS && fieldType === drapcode_constant_1.FieldTypes.boolean.id && fieldValue)
401
415
  return JSON.parse(fieldValue)
402
416
  ? (_z = {},
403
417
  _z[field] = JSON.parse(fieldValue),
@@ -407,7 +421,7 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
407
421
  (_1 = {}, _1[field] = { $exists: false }, _1),
408
422
  ],
409
423
  };
410
- if (key === drapcode_constant_1.EQUALS_OR_IGNORE && fieldType === "boolean") {
424
+ if (key === drapcode_constant_1.EQUALS_OR_IGNORE && fieldType === drapcode_constant_1.FieldTypes.boolean.id) {
411
425
  return !fieldValue.includes("random_string_since_field_not_present_1318874398806")
412
426
  ? JSON.parse(fieldValue)
413
427
  ? (_2 = {},
@@ -423,22 +437,21 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
423
437
  if (key == drapcode_constant_1.EQUALS) {
424
438
  console.log("I am query parser");
425
439
  console.log("fieldType", fieldType);
426
- if (fieldType === "boolean") {
440
+ if (fieldType === drapcode_constant_1.FieldTypes.boolean.id) {
427
441
  return _5 = {}, _5[field] = !!fieldValue, _5;
428
442
  }
429
- if (fieldType === "number") {
443
+ if (fieldType === drapcode_constant_1.FieldTypes.number.id) {
430
444
  return _6 = {}, _6[field] = +fieldValue, _6;
431
445
  }
432
- else {
433
- return _7 = {}, _7[field] = fieldValue, _7;
434
- }
446
+ console.log("Nothing match");
447
+ return _7 = {}, _7[field] = "".concat(fieldValue), _7;
435
448
  }
436
449
  if (key === drapcode_constant_1.EQUALS_OR_IGNORE) {
437
- if (fieldType === "boolean") {
450
+ if (fieldType === drapcode_constant_1.FieldTypes.boolean.id) {
438
451
  return !fieldValue.includes("random_string_since_field_not_present_1318874398806")
439
452
  ? (_8 = {}, _8[field] = !!fieldValue, _8) : {};
440
453
  }
441
- if (fieldType === "number") {
454
+ if (fieldType === drapcode_constant_1.FieldTypes.number.id) {
442
455
  return !fieldValue.includes("random_string_since_field_not_present_1318874398806")
443
456
  ? (_9 = {}, _9[field] = +fieldValue, _9) : {};
444
457
  }
@@ -448,13 +461,13 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
448
461
  }
449
462
  }
450
463
  if (key == drapcode_constant_1.NOT_EQUAL)
451
- if (fieldType === "number") {
464
+ if (fieldType === drapcode_constant_1.FieldTypes.number.id) {
452
465
  return _11 = {}, _11[field] = { $ne: +fieldValue }, _11;
453
466
  }
454
467
  else
455
468
  return _12 = {},
456
469
  _12[field] = {
457
- $ne: fieldType === "boolean" && fieldValue
470
+ $ne: fieldType === drapcode_constant_1.FieldTypes.boolean.id && fieldValue
458
471
  ? JSON.parse(fieldValue)
459
472
  : fieldValue,
460
473
  },
@@ -504,12 +517,12 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
504
517
  var key = query.key, value = query.value, fieldType = query.fieldType;
505
518
  if (fieldType &&
506
519
  !requiredExternal &&
507
- ["dynamic_option", "reference", "static_option", "belongsTo"].includes(fieldType)) {
520
+ [drapcode_constant_1.FieldTypes.dynamic_option.id, drapcode_constant_1.FieldTypes.reference.id, drapcode_constant_1.FieldTypes.static_option.id, drapcode_constant_1.FieldTypes.belongsTo.id].includes(fieldType)) {
508
521
  //Todo: Remove if filter is working properly
509
522
  // return value === CURRENT_USER ? currentUser["uuid"] : value;
510
523
  var refCollection = query.refCollection, refField = query.refField;
511
524
  var finalValue = "";
512
- if (["dynamic_option", "static_option"].includes(fieldType)) {
525
+ if ([drapcode_constant_1.FieldTypes.dynamic_option.id, drapcode_constant_1.FieldTypes.static_option.id].includes(fieldType)) {
513
526
  if (!value) {
514
527
  if (refCollection === drapcode_constant_1.CURRENT_USER) {
515
528
  finalValue = currentUser[refField];
@@ -530,7 +543,7 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
530
543
  return finalValue;
531
544
  }
532
545
  if (fieldType &&
533
- fieldType === "boolean" &&
546
+ fieldType === drapcode_constant_1.FieldTypes.boolean.id &&
534
547
  ["true", "false", "", true, false].includes(value)) {
535
548
  return "" + value;
536
549
  }
@@ -672,7 +685,7 @@ var getSearchObjQuery = function (searchObj, searchQueryTypeObj, timezone) {
672
685
  var searchAggregateQuery = [];
673
686
  var likeQuery = [];
674
687
  Object.entries(searchObj).forEach(function (_a) {
675
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
688
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
676
689
  var key = _a[0], value = _a[1];
677
690
  if (value) {
678
691
  var searchQueryTypeKey = searchQueryTypeObj[key];
@@ -689,10 +702,10 @@ var getSearchObjQuery = function (searchObj, searchQueryTypeObj, timezone) {
689
702
  _c));
690
703
  }
691
704
  else if ([
692
- "static_option",
693
- "dynamic_option",
694
- "reference",
695
- "belongsTo",
705
+ drapcode_constant_1.FieldTypes.static_option.id,
706
+ drapcode_constant_1.FieldTypes.dynamic_option.id,
707
+ drapcode_constant_1.FieldTypes.reference.id,
708
+ drapcode_constant_1.FieldTypes.belongsTo.id,
696
709
  ].includes(searchQueryTypeKey)) {
697
710
  // if input is string and db field type is array
698
711
  searchAggregateQuery.push({
@@ -719,41 +732,54 @@ var getSearchObjQuery = function (searchObj, searchQueryTypeObj, timezone) {
719
732
  _g));
720
733
  }
721
734
  else if (searchQueryTypeKey === "number") {
722
- // handling value when db field type is Double/Int
723
- searchAggregateQuery.push({
724
- $addFields: (_h = {},
725
- _h["_".concat(key)] = { $toString: { $toLong: "$".concat(key) } },
726
- _h),
727
- });
728
- likeQuery.push((_j = {},
729
- _j["_".concat(key)] = {
730
- $regex: value,
731
- $options: "i",
732
- },
733
- _j));
735
+ if (key.startsWith("min_") || key.startsWith("max_")) {
736
+ var fieldKey = key.replace("min_", "");
737
+ fieldKey = fieldKey.replace("max_", "");
738
+ var numericValue = Number(value);
739
+ if (key.startsWith("min_")) {
740
+ likeQuery.push((_h = {}, _h["".concat(fieldKey)] = { $gte: numericValue }, _h));
741
+ }
742
+ else if (key.startsWith("max_")) {
743
+ likeQuery.push((_j = {}, _j["".concat(fieldKey)] = { $lte: numericValue }, _j));
744
+ }
745
+ }
746
+ else {
747
+ // handling value when db field type is Double/Int
748
+ searchAggregateQuery.push({
749
+ $addFields: (_k = {},
750
+ _k["_".concat(key)] = { $toString: { $toLong: "$".concat(key) } },
751
+ _k),
752
+ });
753
+ likeQuery.push((_l = {},
754
+ _l["_".concat(key)] = {
755
+ $regex: value,
756
+ $options: "i",
757
+ },
758
+ _l));
759
+ }
734
760
  }
735
- else if (["date", "createdAt", "time_slot"].includes(searchQueryTypeKey)) {
761
+ else if (__spreadArray(__spreadArray([drapcode_constant_1.FieldTypes.date.id], drapcode_constant_1.systemDateField, true), [drapcode_constant_1.FieldTypes.time_slot.id], false).includes(searchQueryTypeKey)) {
736
762
  if (key.startsWith("start_") || key.startsWith("end_")) {
737
763
  var fieldKey = key.replace("start_", "");
738
764
  fieldKey = fieldKey.replace("end_", "");
739
765
  searchAggregateQuery.push({
740
- $addFields: (_k = {},
741
- _k["_".concat(key)] = { $toString: "$".concat(fieldKey) },
742
- _k),
766
+ $addFields: (_m = {},
767
+ _m["_".concat(key)] = { $toString: "$".concat(fieldKey) },
768
+ _m),
743
769
  });
744
770
  if (key.startsWith("start_")) {
745
- likeQuery.push((_l = {},
746
- _l["_".concat(key)] = {
747
- $gte: (0, date_util_1.timezoneDateParse)(value, false, true),
771
+ likeQuery.push((_o = {},
772
+ _o["_".concat(key)] = {
773
+ $gte: (0, date_util_1.timezoneDateParse)(value, true, true),
748
774
  },
749
- _l));
775
+ _o));
750
776
  }
751
777
  else if (key.startsWith("end_")) {
752
- likeQuery.push((_m = {},
753
- _m["_".concat(key)] = {
778
+ likeQuery.push((_p = {},
779
+ _p["_".concat(key)] = {
754
780
  $lt: (0, date_util_1.timezoneDateParse)(value, true),
755
781
  },
756
- _m));
782
+ _p));
757
783
  }
758
784
  }
759
785
  }
@@ -761,25 +787,25 @@ var getSearchObjQuery = function (searchObj, searchQueryTypeObj, timezone) {
761
787
  // if input is string and db field type is number
762
788
  // converting db field to string first
763
789
  searchAggregateQuery.push({
764
- $addFields: (_o = {},
765
- _o["_".concat(key)] = { $toString: "$".concat(key) },
766
- _o),
790
+ $addFields: (_q = {},
791
+ _q["_".concat(key)] = { $toString: "$".concat(key) },
792
+ _q),
767
793
  });
768
- likeQuery.push((_p = {},
769
- _p["_".concat(key)] = {
794
+ likeQuery.push((_r = {},
795
+ _r["_".concat(key)] = {
770
796
  $regex: value,
771
797
  $options: "i",
772
798
  },
773
- _p));
799
+ _r));
774
800
  }
775
801
  }
776
802
  else {
777
- likeQuery.push((_q = {},
778
- _q[key] = {
803
+ likeQuery.push((_s = {},
804
+ _s[key] = {
779
805
  $regex: value,
780
806
  $options: "i",
781
807
  },
782
- _q));
808
+ _s));
783
809
  }
784
810
  }
785
811
  });
@@ -202,13 +202,10 @@ var queryParserNew = function (collectionName, query, constants, externalParams,
202
202
  }
203
203
  }
204
204
  });
205
- console.log("==> aggregateQuery", aggregateQuery);
206
- console.log("==> likeQuery", likeQuery_1);
207
205
  if (likeQuery_1.length) {
208
206
  aggregateQuery.push({ $match: { $and: likeQuery_1 } });
209
207
  }
210
208
  }
211
- console.log("==> query", query);
212
209
  projection = mongoSelectQuery(query);
213
210
  finder = query.finder, sortBy = query.sortBy, orderBy = query.orderBy, aggregateFunctionField = query.aggregateFunctionField;
214
211
  if (!(finder != "COUNT" && refCollectionFieldsInItems)) return [3 /*break*/, 2];
@@ -504,9 +501,8 @@ var queryToMongo = function (query, requiredExternal, externalParams, constants,
504
501
  if (fieldType === "number") {
505
502
  return _8 = {}, _8[field] = +fieldValue, _8;
506
503
  }
507
- else {
508
- return _9 = {}, _9[field] = fieldValue, _9;
509
- }
504
+ console.log("Nothing match");
505
+ return _9 = {}, _9[field] = "".concat(fieldValue), _9;
510
506
  }
511
507
  if (key === drapcode_constant_1.EQUALS_OR_IGNORE) {
512
508
  if (fieldType === "boolean") {
@@ -620,20 +616,16 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
620
616
  else
621
617
  return "".concat(startValue_1, "---").concat(endValue_1);
622
618
  }
623
- console.log("==> value", value);
624
- console.log("==> currentUser", currentUser);
625
619
  if (value.includes(drapcode_constant_1.CURRENT_USER)) {
626
620
  if (value === drapcode_constant_1.CURRENT_USER) {
627
621
  return currentUser["uuid"];
628
622
  }
629
623
  var splitValues = value.split("::");
630
- console.log("splitValues", splitValues);
631
624
  var refCollection = splitValues[1];
632
625
  var refCollectionField = splitValues[2];
633
626
  if (refCollection && refCollectionField) {
634
627
  console.log("I have refCollection and Field");
635
628
  var refCollectionData = currentUser[refCollection];
636
- console.log("refCollectionData", refCollectionData);
637
629
  if (!refCollectionData) {
638
630
  return "";
639
631
  }
@@ -298,28 +298,34 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
298
298
  var _a;
299
299
  var contentList = (_a = expression
300
300
  .match(/{{(.*?)}}/g)) === null || _a === void 0 ? void 0 : _a.map(function (b) { return b.replace(/{{(.*?)}}/g, "$1"); });
301
+ console.log("1 replaceDataValueIntoExpression");
301
302
  contentList === null || contentList === void 0 ? void 0 : contentList.forEach(function (prop) {
302
303
  var needle = "{{".concat(prop, "}}");
304
+ console.log("needle :>> ", needle);
303
305
  var dataOfItem = "";
304
306
  if (prop.includes("current_user")) {
307
+ console.log("Current User");
305
308
  prop = prop.replace("current_user.", "");
306
309
  if (Object.keys(user).length > 0) {
307
310
  dataOfItem = (0, exports.parseValueFromData)(user, prop);
308
311
  }
309
312
  }
310
313
  else if (prop.includes("current_tenant")) {
314
+ console.log("Current Tenant");
311
315
  prop = prop.replace("current_tenant.", "");
312
316
  if (Object.keys(tenant).length > 0) {
313
317
  dataOfItem = (0, exports.parseValueFromData)(tenant, prop);
314
318
  }
315
319
  }
316
320
  else if (prop.includes("current_settings")) {
321
+ console.log("Current Setting");
317
322
  prop = prop.replace("current_settings.", "");
318
323
  if (Object.keys(userSetting).length > 0) {
319
324
  dataOfItem = (0, exports.parseValueFromData)(userSetting, prop);
320
325
  }
321
326
  }
322
327
  else if (prop.includes("current_session")) {
328
+ console.log("Current Session");
323
329
  prop = prop.replace("current_session.", "");
324
330
  if (Object.keys(sessionValue).length > 0) {
325
331
  //Session will contain multi level data
@@ -327,6 +333,7 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
327
333
  }
328
334
  }
329
335
  else if (prop.includes("form_data_session")) {
336
+ console.log("Form Data Session");
330
337
  prop = prop.replace("form_data_session.", "");
331
338
  if (Object.keys(sessionFormValue).length > 0) {
332
339
  //Form Session will contain multi level data
@@ -334,6 +341,7 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
334
341
  }
335
342
  }
336
343
  else if (prop.includes("SESSION_STORAGE")) {
344
+ console.log("Session Storage");
337
345
  prop = prop.replace("SESSION_STORAGE.", "");
338
346
  if (Object.keys(sessionValue).length > 0) {
339
347
  //Session will contain multi level data
@@ -341,6 +349,7 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
341
349
  }
342
350
  }
343
351
  else if (prop.includes("LOCAL_STORAGE")) {
352
+ console.log("Local Storage");
344
353
  prop = prop.replace("LOCAL_STORAGE.", "");
345
354
  if (Object.keys(localStorageValue).length > 0) {
346
355
  //Session will contain multi level data
@@ -348,6 +357,7 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
348
357
  }
349
358
  }
350
359
  else if (prop.includes("COOKIES")) {
360
+ console.log("Cookies");
351
361
  prop = prop.replace("COOKIES.", "");
352
362
  if (Object.keys(cookiesValue).length > 0) {
353
363
  //Session will contain multi level data
@@ -355,6 +365,7 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
355
365
  }
356
366
  }
357
367
  else if (prop.includes("environment_variable")) {
368
+ console.log("Environment Variable");
358
369
  prop = prop.replace("environment_variable.", "");
359
370
  if (Object.keys(envConstants).length > 0) {
360
371
  var selectedConstant = envConstants.find(function (constant) { return constant.name === prop; });
@@ -362,11 +373,16 @@ var replaceDataValueIntoExpression = function (expression, data, user, tenant, u
362
373
  }
363
374
  }
364
375
  else {
376
+ console.log("Nothing Matches");
365
377
  if (Object.keys(data).length > 0) {
366
378
  dataOfItem = (0, exports.parseValueFromData)(data, prop);
379
+ //TODO: Need better way
380
+ delete data[prop];
367
381
  }
368
382
  }
383
+ console.log("dataOfItem :>> ", dataOfItem);
369
384
  expression = replaceValueInExpression(needle, dataOfItem, expression);
385
+ console.log("expression :>> ", expression);
370
386
  });
371
387
  return expression;
372
388
  };
@@ -425,6 +441,7 @@ var parseValueFromData = function (data, fieldName) {
425
441
  else {
426
442
  value = data ? data[fieldName] : "";
427
443
  }
444
+ console.log("value :>> ", value);
428
445
  if (value && Array.isArray(value) && typeof value[0] === "string") {
429
446
  return value.join(", ");
430
447
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drapcode-utility",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",