@bigbinary/neeto-commons-frontend 2.0.99 → 2.0.101

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/pure.d.ts CHANGED
@@ -14,7 +14,7 @@ type MatchPattern<Obj = any, Parent = Obj> = Obj extends any[] ? Matchable<Obj,
14
14
  *
15
15
  * Failsafe status: alternative available
16
16
  *
17
- * Converts camelCase to snake_case.
17
+ * Converts camelCase string to snake_case.
18
18
  *
19
19
  * @example
20
20
  *
@@ -50,24 +50,6 @@ export function _capitalize(string: NilOr<string>): NilOr<string>;
50
50
  *
51
51
  * keys in the resulting array.
52
52
  *
53
- * A function that accepts an input array and returns a new array with elements
54
- *
55
- * such that: each element will contain the newly specified keys with its value
56
- *
57
- * same as the value of specified source keys.
58
- *
59
- * Usage:
60
- *
61
- * @example
62
- *
63
- * copyKeys({
64
- * sourceKey1: "destinationKey1",
65
- * sourceKey2: "destinationKey2",
66
- * ...
67
- * }, arrayOfObjects);
68
- * @endexample
69
- * Example:
70
- *
71
53
  * @example
72
54
  *
73
55
  * const data = [
@@ -99,24 +81,6 @@ export function copyKeys<T>(keyMap: { [key in keyof Partial<T>]: string }, objec
99
81
  *
100
82
  * keys in the resulting array.
101
83
  *
102
- * A function that accepts an input array and returns a new array with elements
103
- *
104
- * such that: each element will contain the newly specified keys with its value
105
- *
106
- * same as the value of specified source keys.
107
- *
108
- * Usage:
109
- *
110
- * @example
111
- *
112
- * copyKeys({
113
- * sourceKey1: "destinationKey1",
114
- * sourceKey2: "destinationKey2",
115
- * ...
116
- * }, arrayOfObjects);
117
- * @endexample
118
- * Example:
119
- *
120
84
  * @example
121
85
  *
122
86
  * const data = [
@@ -158,29 +122,6 @@ export function _copyKeys(keyMap: {
158
122
  *
159
123
  * has a different structure for the key mapping to support nesting.
160
124
  *
161
- * They key mapping object is completely different from the one used in copyKeys
162
- *
163
- * to support object nesting. It accepts destination as key and source as value.
164
- *
165
- * Source can be of three types
166
- *
167
- * Usage:
168
- *
169
- * @example
170
- *
171
- * copyKeysDeep({
172
- * destinationKey: "sourceKey",
173
- * {
174
- * destinationKey: "sourceKeyInNestedObject",
175
- * },
176
- * {
177
- * destinationKey2: ["path", "to", "sourceKeyInNestedObject"],
178
- * destinationKey3: (value, root) => value + root.id,
179
- * }
180
- * }, arrayOfObjects);
181
- * @endexample
182
- * Example:
183
- *
184
125
  * @example
185
126
  *
186
127
  * const data = [
@@ -201,7 +142,7 @@ export function _copyKeys(keyMap: {
201
142
  * ];
202
143
  *
203
144
  * // reformatting `data` to label-and-value format for neetoui-select.
204
- * copyKeys(
145
+ * copyKeysDeep(
205
146
  * {
206
147
  * name: "label",
207
148
  * quantity: (qty, root) => qty + root.user.bonusQty,
@@ -243,29 +184,6 @@ export function copyKeysDeep(keyMap: object, objectArray: object[]): object[];
243
184
  *
244
185
  * has a different structure for the key mapping to support nesting.
245
186
  *
246
- * They key mapping object is completely different from the one used in copyKeys
247
- *
248
- * to support object nesting. It accepts destination as key and source as value.
249
- *
250
- * Source can be of three types
251
- *
252
- * Usage:
253
- *
254
- * @example
255
- *
256
- * copyKeysDeep({
257
- * destinationKey: "sourceKey",
258
- * {
259
- * destinationKey: "sourceKeyInNestedObject",
260
- * },
261
- * {
262
- * destinationKey2: ["path", "to", "sourceKeyInNestedObject"],
263
- * destinationKey3: (value, root) => value + root.id,
264
- * }
265
- * }, arrayOfObjects);
266
- * @endexample
267
- * Example:
268
- *
269
187
  * @example
270
188
  *
271
189
  * const data = [
@@ -286,7 +204,7 @@ export function copyKeysDeep(keyMap: object, objectArray: object[]): object[];
286
204
  * ];
287
205
  *
288
206
  * // reformatting `data` to label-and-value format for neetoui-select.
289
- * copyKeys(
207
+ * copyKeysDeep(
290
208
  * {
291
209
  * name: "label",
292
210
  * quantity: (qty, root) => qty + root.user.bonusQty,
@@ -328,8 +246,6 @@ export function _copyKeysDeep(keyMap: object): (objectArray: NilOr<object[]>) =>
328
246
  *
329
247
  * Counts an array of items for items that matches the given pattern.
330
248
  *
331
- * Usage:
332
- *
333
249
  * @example
334
250
  *
335
251
  * const array = [
@@ -353,8 +269,6 @@ export function countBy<T>(pattern: MatchPattern<T>, entityArray: T[]): number;
353
269
  *
354
270
  * Counts an array of items for items that matches the given pattern.
355
271
  *
356
- * Usage:
357
- *
358
272
  * @example
359
273
  *
360
274
  * const array = [
@@ -378,11 +292,7 @@ export function _countBy(pattern: MatchPattern): (entityArray: NilOr<object[]>)
378
292
  *
379
293
  * Failsafe status: failsafe by default
380
294
  *
381
- * To make an object immutable, recursively freeze each property which is of type
382
- *
383
- * object.
384
- *
385
- * Usage:
295
+ * To make an object immutable, recursively freeze each property which is of type object.
386
296
  *
387
297
  * @example
388
298
  *
@@ -404,9 +314,7 @@ export function _countBy(pattern: MatchPattern): (entityArray: NilOr<object[]>)
404
314
  * };
405
315
  *
406
316
  * @endexample
407
- * The assignment operation will throw the error only when we execute it in strict
408
- *
409
- * mode, in non-strict mode it will fail silently.
317
+ * The assignment operation will throw the error only when we execute it in strict mode, in non-strict mode it will fail silently.
410
318
  *
411
319
  * @example
412
320
  *
@@ -434,8 +342,6 @@ export function deepFreezeObject<T>(object: T): Readonly<T>;
434
342
  *
435
343
  * corresponding to that index.
436
344
  *
437
- * Usage:
438
- *
439
345
  * @example
440
346
  *
441
347
  * dynamicArray(3, index => `option ${index + 1}`);
@@ -454,8 +360,6 @@ export function dynamicArray<T>(count: number, elementGenerator: (index: number)
454
360
  *
455
361
  * found, false otherwise.
456
362
  *
457
- * Usage:
458
- *
459
363
  * @example
460
364
  *
461
365
  * const array = [
@@ -478,8 +382,6 @@ export function existsBy<T>(pattern: MatchPattern<T>, entityArray: T[]): boolean
478
382
  *
479
383
  * found, false otherwise.
480
384
  *
481
- * Usage:
482
- *
483
385
  * @example
484
386
  *
485
387
  * const array = [
@@ -502,8 +404,6 @@ export function _existsBy(pattern: MatchPattern): (entityArray: NilOr<object[]>)
502
404
  *
503
405
  * Search for an item in the given array using the given id.
504
406
  *
505
- * Usage:
506
- *
507
407
  * @example
508
408
  *
509
409
  * const array = [
@@ -524,8 +424,6 @@ export function existsById(id: any, entityArray: object[]): boolean;
524
424
  *
525
425
  * Search for an item in the given array using the given id.
526
426
  *
527
- * Usage:
528
- *
529
427
  * @example
530
428
  *
531
429
  * const array = [
@@ -548,8 +446,6 @@ export function _existsById(id: any): (entityArray: NilOr<object[]>) => NilOr<bo
548
446
  *
549
447
  * Filter an array of items based on pattern matching.
550
448
  *
551
- * Usage:
552
- *
553
449
  * @example
554
450
  *
555
451
  * const array = [
@@ -573,8 +469,6 @@ export function filterBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T[];
573
469
  *
574
470
  * Filter an array of items based on pattern matching.
575
471
  *
576
- * Usage:
577
- *
578
472
  * @example
579
473
  *
580
474
  * const array = [
@@ -628,8 +522,6 @@ export function _filterNonNull(object: NilOr<object>): NilOr<object>;
628
522
  *
629
523
  * Find the first item that matches the given pattern from an array.
630
524
  *
631
- * Usage:
632
- *
633
525
  * @example
634
526
  *
635
527
  * const array = [
@@ -651,8 +543,6 @@ export function findBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T;
651
543
  *
652
544
  * Find the first item that matches the given pattern from an array.
653
545
  *
654
- * Usage:
655
- *
656
546
  * @example
657
547
  *
658
548
  * const array = [
@@ -676,8 +566,6 @@ export function _findBy(pattern: MatchPattern): <T>(entityArray: NilOr<T[]>) =>
676
566
  *
677
567
  * Find an object having the given id from an array.
678
568
  *
679
- * Usage:
680
- *
681
569
  * @example
682
570
  *
683
571
  * const array = [
@@ -699,8 +587,6 @@ export function findById<T>(id: any, entityArray: T[]): T;
699
587
  *
700
588
  * Find an object having the given id from an array.
701
589
  *
702
- * Usage:
703
- *
704
590
  * @example
705
591
  *
706
592
  * const array = [
@@ -724,8 +610,6 @@ export function _findById(id: any): <T>(entityArray: NilOr<T[]>) => NilOr<T>;
724
610
  *
725
611
  * Find the index of an item that matches the pattern from the given array.
726
612
  *
727
- * Usage:
728
- *
729
613
  * @example
730
614
  *
731
615
  * const array = [
@@ -747,8 +631,6 @@ export function findIndexBy<T>(pattern: MatchPattern<T>, entityArray: T[]): numb
747
631
  *
748
632
  * Find the index of an item that matches the pattern from the given array.
749
633
  *
750
- * Usage:
751
- *
752
634
  * @example
753
635
  *
754
636
  * const array = [
@@ -774,8 +656,6 @@ export function _findIndexBy(pattern: MatchPattern): (entityArray: NilOr<object[
774
656
  *
775
657
  * entities inside it.
776
658
  *
777
- * Usage:
778
- *
779
659
  * @example
780
660
  *
781
661
  * const array = [
@@ -799,8 +679,6 @@ export function findIndexById(id: any, entityArray: object[]): number;
799
679
  *
800
680
  * entities inside it.
801
681
  *
802
- * Usage:
803
- *
804
682
  * @example
805
683
  *
806
684
  * const array = [
@@ -824,8 +702,6 @@ export function _findIndexById(id: any): (entityArray: NilOr<object[]>) => NilOr
824
702
  *
825
703
  * Find the last item that matches the given pattern.
826
704
  *
827
- * Usage:
828
- *
829
705
  * @example
830
706
  *
831
707
  * const array = [
@@ -848,8 +724,6 @@ export function findLastBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T;
848
724
  *
849
725
  * Find the last item that matches the given pattern.
850
726
  *
851
- * Usage:
852
- *
853
727
  * @example
854
728
  *
855
729
  * const array = [
@@ -874,8 +748,6 @@ export function _findLastBy(pattern: MatchPattern): <T>(entityArray: NilOr<T[]>)
874
748
  *
875
749
  * Find the last index of item that matches the given pattern.
876
750
  *
877
- * Usage:
878
- *
879
751
  * @example
880
752
  *
881
753
  * const array = [
@@ -898,8 +770,6 @@ export function findLastIndexBy(id: any, entityArray: object[]): number;
898
770
  *
899
771
  * Find the last index of item that matches the given pattern.
900
772
  *
901
- * Usage:
902
- *
903
773
  * @example
904
774
  *
905
775
  * const array = [
@@ -922,9 +792,7 @@ export function _findLastIndexBy(id: any): (entityArray: NilOr<object[]>) => Nil
922
792
  *
923
793
  * Failsafe status: not failsafe
924
794
  *
925
- * This function is used to generate a random integer.
926
- *
927
- * Here are some sample usages:
795
+ * This function is used to generate a random integer in the given range. If only 1 argument is provided, it is considered as the upper bound.
928
796
  *
929
797
  * @example
930
798
  *
@@ -966,6 +834,12 @@ export function isNot(a: any): (b: any) => boolean;
966
834
  *
967
835
  * objects). False otherwise. (the opposite of isEmpty in ramda)
968
836
  *
837
+ * @example
838
+ *
839
+ * isNotEmpty(""); // returns false
840
+ * isNotEmpty(["a"]); // returns true
841
+ * isNotEMpty({ name: "Oliver" }); //return true
842
+ * @endexample
969
843
  */
970
844
  export const isNotEmpty: (a: any) => boolean;
971
845
  export function isNotEqualDeep(a: any, b: any): boolean;
@@ -978,8 +852,6 @@ export function isNotEqualDeep(a: any): (b: any) => boolean;
978
852
  *
979
853
  * Recursively converts the snake cased object keys to camel case
980
854
  *
981
- * Usage:
982
- *
983
855
  * @example
984
856
  *
985
857
  * keysToCamelCase({
@@ -1005,8 +877,6 @@ export function keysToCamelCase(object: any): any;
1005
877
  *
1006
878
  * Recursively converts the camel cased object keys to snake case.
1007
879
  *
1008
- * Usage:
1009
- *
1010
880
  * @example
1011
881
  *
1012
882
  * keysToSnakeCase({
@@ -1030,33 +900,7 @@ export function keysToSnakeCase(object: any): any;
1030
900
  *
1031
901
  * Failsafe status: failsafe by default
1032
902
  *
1033
- * Checks whether the given object matches the given pattern. Each primitive value
1034
- *
1035
- * (int, boolean, string, etc.) in the pattern should be same as the corresponding
1036
- *
1037
- * value in the object (deeply) for a match.
1038
- *
1039
- * This function accepts two objects (pattern and data) as parameters and returns
1040
- *
1041
- * true if all the keys in pattern exist in data and the primitive values of those
1042
- *
1043
- * keys are identical to the data. Object values are compared recursively for inner
1044
- *
1045
- * primitives.
1046
- *
1047
- * If a function is passed as pattern's property, and equality test is performed
1048
- *
1049
- * with corresponding object property. If equality fails, the function will be
1050
- *
1051
- * evaluated with the value of the corresponding property of the data. If function
1052
- *
1053
- * returns true, it will be considered as a match.
1054
- *
1055
- * In short, this function checks whether all the primitive keys in the pattern is
1056
- *
1057
- * equal to corresponding keys in the data and all conditions (functions) are
1058
- *
1059
- * satisfied.
903
+ * Checks whether the given object matches the given pattern. Each primitive value (int, boolean, string, etc.) in the pattern should be same as the corresponding value in the object (deeply) and all conditions (functions) should be satisfied for a match.
1060
904
  *
1061
905
  * @example
1062
906
  *
@@ -1087,33 +931,7 @@ export function matches<T>(pattern: MatchPattern<T>, data: T): boolean;
1087
931
  *
1088
932
  * Failsafe status: failsafe by default
1089
933
  *
1090
- * Checks whether the given object matches the given pattern. Each primitive value
1091
- *
1092
- * (int, boolean, string, etc.) in the pattern should be same as the corresponding
1093
- *
1094
- * value in the object (deeply) for a match.
1095
- *
1096
- * This function accepts two objects (pattern and data) as parameters and returns
1097
- *
1098
- * true if all the keys in pattern exist in data and the primitive values of those
1099
- *
1100
- * keys are identical to the data. Object values are compared recursively for inner
1101
- *
1102
- * primitives.
1103
- *
1104
- * If a function is passed as pattern's property, and equality test is performed
1105
- *
1106
- * with corresponding object property. If equality fails, the function will be
1107
- *
1108
- * evaluated with the value of the corresponding property of the data. If function
1109
- *
1110
- * returns true, it will be considered as a match.
1111
- *
1112
- * In short, this function checks whether all the primitive keys in the pattern is
1113
- *
1114
- * equal to corresponding keys in the data and all conditions (functions) are
1115
- *
1116
- * satisfied.
934
+ * Checks whether the given object matches the given pattern. Each primitive value (int, boolean, string, etc.) in the pattern should be same as the corresponding value in the object (deeply) and all conditions (functions) should be satisfied for a match.
1117
935
  *
1118
936
  * @example
1119
937
  *
@@ -1148,8 +966,6 @@ export function matches(pattern: MatchPattern): (data: any) => boolean;
1148
966
  *
1149
967
  * argument to the function.
1150
968
  *
1151
- * Usage:
1152
- *
1153
969
  * @example
1154
970
  *
1155
971
  * const array = [
@@ -1175,8 +991,6 @@ export function modifyBy<T>(pattern: MatchPattern<T>, modifier: (previous: T) =>
1175
991
  *
1176
992
  * argument to the function.
1177
993
  *
1178
- * Usage:
1179
- *
1180
994
  * @example
1181
995
  *
1182
996
  * const array = [
@@ -1202,8 +1016,6 @@ export function modifyBy<T>(pattern: MatchPattern<T>, modifier: (previous: T) =>
1202
1016
  *
1203
1017
  * argument to the function.
1204
1018
  *
1205
- * Usage:
1206
- *
1207
1019
  * @example
1208
1020
  *
1209
1021
  * const array = [
@@ -1229,8 +1041,6 @@ export function modifyBy(pattern: MatchPattern): <T>(modifier: (previous: T) =>
1229
1041
  *
1230
1042
  * argument to the function.
1231
1043
  *
1232
- * Usage:
1233
- *
1234
1044
  * @example
1235
1045
  *
1236
1046
  * const array = [
@@ -1262,8 +1072,6 @@ export function _modifyBy(pattern: MatchPattern): <T>(modifier: (previous: T) =>
1262
1072
  *
1263
1073
  * of the match.
1264
1074
  *
1265
- * Usage:
1266
- *
1267
1075
  * @example
1268
1076
  *
1269
1077
  * const array = [
@@ -1292,8 +1100,6 @@ export function modifyById<T>(id: any, modifier: (previous: T) => T, entityArray
1292
1100
  *
1293
1101
  * of the match.
1294
1102
  *
1295
- * Usage:
1296
- *
1297
1103
  * @example
1298
1104
  *
1299
1105
  * const array = [
@@ -1322,8 +1128,6 @@ export function modifyById<T>(id: any, modifier: (previous: T) => T): (entityArr
1322
1128
  *
1323
1129
  * of the match.
1324
1130
  *
1325
- * Usage:
1326
- *
1327
1131
  * @example
1328
1132
  *
1329
1133
  * const array = [
@@ -1352,8 +1156,6 @@ export function modifyById(id: any): <T>(modifier: (previous: T) => T, entityArr
1352
1156
  *
1353
1157
  * of the match.
1354
1158
  *
1355
- * Usage:
1356
- *
1357
1159
  * @example
1358
1160
  *
1359
1161
  * const array = [
@@ -1398,8 +1200,6 @@ export function notEqualsDeep(a: any): (b: any) => boolean;
1398
1200
  *
1399
1201
  * element from the list of arguments.
1400
1202
  *
1401
- * Usage:
1402
- *
1403
1203
  * @example
1404
1204
  *
1405
1205
  * randomPick("arg1", "arg2", "arg3", "arg4", "arg5");
@@ -1416,8 +1216,6 @@ export function randomPick<T>(...args: T[]): T;
1416
1216
  *
1417
1217
  * Remove all items that matches the given pattern from an array of items.
1418
1218
  *
1419
- * Usage:
1420
- *
1421
1219
  * @example
1422
1220
  *
1423
1221
  * const array = [
@@ -1439,8 +1237,6 @@ export function removeBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T[];
1439
1237
  *
1440
1238
  * Remove all items that matches the given pattern from an array of items.
1441
1239
  *
1442
- * Usage:
1443
- *
1444
1240
  * @example
1445
1241
  *
1446
1242
  * const array = [
@@ -1464,8 +1260,6 @@ export function _removeBy(pattern: MatchPattern): <T>(entityArray: NilOr<T[]>) =
1464
1260
  *
1465
1261
  * Return a new array with the item with the given id removed.
1466
1262
  *
1467
- * Usage:
1468
- *
1469
1263
  * @example
1470
1264
  *
1471
1265
  * const array = [
@@ -1487,8 +1281,6 @@ export function removeById<T>(id: any, entityArray: T[]): T[];
1487
1281
  *
1488
1282
  * Return a new array with the item with the given id removed.
1489
1283
  *
1490
- * Usage:
1491
- *
1492
1284
  * @example
1493
1285
  *
1494
1286
  * const array = [
@@ -1514,26 +1306,6 @@ export function _removeById(id: any): <T>(entityArray: NilOr<T[]>) => NilOr<T[]>
1514
1306
  *
1515
1307
  * array. This creates a new instance and doesn't mutate the array.
1516
1308
  *
1517
- * A function that accepts an input array and returns a new array with elements
1518
- *
1519
- * such that: each element will contain the newly specified keys with its value
1520
- *
1521
- * pointing to the value of specified source keys. The source keys will not be
1522
- *
1523
- * copied.
1524
- *
1525
- * Usage:
1526
- *
1527
- * @example
1528
- *
1529
- * renameKeys({
1530
- * sourceKey1: "destinationKey1",
1531
- * sourceKey2: "destinationKey2",
1532
- * ...
1533
- * }, arrayOfObjects);
1534
- * @endexample
1535
- * Example:
1536
- *
1537
1309
  * @example
1538
1310
  *
1539
1311
  * const data = [
@@ -1565,26 +1337,6 @@ export function renameKeys<T, M extends { [key in keyof Partial<T>]: string }>(k
1565
1337
  *
1566
1338
  * array. This creates a new instance and doesn't mutate the array.
1567
1339
  *
1568
- * A function that accepts an input array and returns a new array with elements
1569
- *
1570
- * such that: each element will contain the newly specified keys with its value
1571
- *
1572
- * pointing to the value of specified source keys. The source keys will not be
1573
- *
1574
- * copied.
1575
- *
1576
- * Usage:
1577
- *
1578
- * @example
1579
- *
1580
- * renameKeys({
1581
- * sourceKey1: "destinationKey1",
1582
- * sourceKey2: "destinationKey2",
1583
- * ...
1584
- * }, arrayOfObjects);
1585
- * @endexample
1586
- * Example:
1587
- *
1588
1340
  * @example
1589
1341
  *
1590
1342
  * const data = [
@@ -1624,8 +1376,6 @@ export function _renameKeys<M extends {
1624
1376
  *
1625
1377
  * Replace all items that matches the given pattern with the given item.
1626
1378
  *
1627
- * Usage:
1628
- *
1629
1379
  * @example
1630
1380
  *
1631
1381
  * const array = [
@@ -1649,8 +1399,6 @@ export function replaceBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T[];
1649
1399
  *
1650
1400
  * Replace all items that matches the given pattern with the given item.
1651
1401
  *
1652
- * Usage:
1653
- *
1654
1402
  * @example
1655
1403
  *
1656
1404
  * const array = [
@@ -1678,8 +1426,6 @@ export function _replaceBy(pattern: MatchPattern): <T>(entityArray: NilOr<T[]>)
1678
1426
  *
1679
1427
  * object.
1680
1428
  *
1681
- * Usage:
1682
- *
1683
1429
  * @example
1684
1430
  *
1685
1431
  * const array = [
@@ -1706,8 +1452,6 @@ export function replaceById<T>(id: any, entityArray: T[]): T[];
1706
1452
  *
1707
1453
  * object.
1708
1454
  *
1709
- * Usage:
1710
- *
1711
1455
  * @example
1712
1456
  *
1713
1457
  * const array = [
@@ -1732,15 +1476,9 @@ export function _replaceById(id: any): <T>(entityArray: NilOr<T[]>) => NilOr<T[]
1732
1476
  *
1733
1477
  * Failsafe status: failsafe by default
1734
1478
  *
1735
- * Recursively converts the camel cased object keys to snake case. It will
1736
- *
1737
- * gracefully handle special objects like Date, dayjs instance etc.
1738
- *
1739
- * While converting, this function checks if the function named toJSON is present
1479
+ * Recursively converts the camel cased object keys to snake case. It will gracefully handle special objects like Date, dayjs instance etc.
1740
1480
  *
1741
- * in the value (if the value is an object) and if found, it calls the function and
1742
- *
1743
- * uses the return value for further processing.
1481
+ * While converting, this function checks if the function named toJSON is present in the value (if the value is an object) and if found, it calls the function and uses the return value for further processing.
1744
1482
  *
1745
1483
  * Example 1:
1746
1484
  *
@@ -1778,13 +1516,7 @@ export function _replaceById(id: any): <T>(entityArray: NilOr<T[]>) => NilOr<T[]
1778
1516
  * }
1779
1517
  *
1780
1518
  * @endexample
1781
- * In the above example, the value of dob is an date object and has toJSON
1782
- *
1783
- * method present in it. The toJSON method returns the date in ISO format which
1784
- *
1785
- * will be used for further processing instead of recursively converting the
1786
- *
1787
- * original date object.
1519
+ * In the above example, the value of dob is an date object and has toJSON method present in it. The toJSON method returns the date in ISO format which will be used for further processing instead of recursively converting the original date object.
1788
1520
  *
1789
1521
  */
1790
1522
  export function serializeKeysToSnakeCase(object: object): object;
@@ -1802,8 +1534,6 @@ export function serializeKeysToSnakeCase(object: object): object;
1802
1534
  *
1803
1535
  * This is helpful when serializing Date objects, dayjs objects etc.
1804
1536
  *
1805
- * Usage:
1806
- *
1807
1537
  * @example
1808
1538
  *
1809
1539
  * preprocessForSerialization(dayjs("1980-01-01")); // returns "1980-01-01T00:00:00.000Z"
@@ -1838,7 +1568,7 @@ export function _slugify(string: NilOr<string>): NilOr<string>;
1838
1568
  *
1839
1569
  * Failsafe status: alternative available
1840
1570
  *
1841
- * Converts snake_case to camelCase.
1571
+ * Converts snake_case string to camelCase.
1842
1572
  *
1843
1573
  * @example
1844
1574
  *
@@ -1857,8 +1587,6 @@ export function _snakeToCamelCase(string: NilOr<string>): NilOr<string>;
1857
1587
  *
1858
1588
  * "label" and "value".
1859
1589
  *
1860
- * Usage:
1861
- *
1862
1590
  * @example
1863
1591
  *
1864
1592
  * toLabelAndValue("test");
@@ -1876,18 +1604,12 @@ export function toLabelAndValue(string: string): {
1876
1604
  *
1877
1605
  * Failsafe status: failsafe by default
1878
1606
  *
1879
- * Passes each key and value of a the given object (recursively) to the given
1607
+ * Passes each key and value of the given object (recursively) to the given
1880
1608
  *
1881
1609
  * transformer function. Reconstructs an object of the same hierarchy with the key
1882
1610
  *
1883
1611
  * value pair the transformer function returns.
1884
1612
  *
1885
- * You can optionally pass an object transformer which will be executed on every
1886
- *
1887
- * value (including the supplied object itself) before any processing is done to
1888
- *
1889
- * it.
1890
- *
1891
1613
  * Usage:
1892
1614
  *
1893
1615
  * @example