@react-pakistan/util-functions 1.24.64 → 1.24.66

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.
Files changed (110) hide show
  1. package/README.md +6 -3
  2. package/api/stellar-solutions/app-user/index.d.ts +63 -14
  3. package/api/stellar-solutions/app-user/index.js +106 -52
  4. package/api/stellar-solutions/bank/index.d.ts +65 -16
  5. package/api/stellar-solutions/bank/index.js +115 -65
  6. package/api/stellar-solutions/branch/index.d.ts +64 -15
  7. package/api/stellar-solutions/branch/index.js +119 -65
  8. package/api/stellar-solutions/company/index.d.ts +58 -24
  9. package/api/stellar-solutions/company/index.js +106 -78
  10. package/api/stellar-solutions/company-report/index.d.ts +12 -5
  11. package/api/stellar-solutions/company-report/index.js +12 -7
  12. package/api/stellar-solutions/contact/index.d.ts +54 -20
  13. package/api/stellar-solutions/contact/index.js +109 -88
  14. package/api/stellar-solutions/currency/index.d.ts +63 -14
  15. package/api/stellar-solutions/currency/index.js +113 -61
  16. package/api/stellar-solutions/customer/index.d.ts +70 -28
  17. package/api/stellar-solutions/customer/index.js +131 -101
  18. package/api/stellar-solutions/expense/index.d.ts +58 -22
  19. package/api/stellar-solutions/expense/index.js +128 -92
  20. package/api/stellar-solutions/expense-category/index.d.ts +58 -22
  21. package/api/stellar-solutions/expense-category/index.js +125 -86
  22. package/api/stellar-solutions/lead/index.js +0 -1
  23. package/api/stellar-solutions/menu-order/index.d.ts +29 -7
  24. package/api/stellar-solutions/menu-order/index.js +74 -27
  25. package/api/stellar-solutions/payment/index.d.ts +62 -27
  26. package/api/stellar-solutions/payment/index.js +144 -123
  27. package/api/stellar-solutions/payment-mode/index.d.ts +44 -12
  28. package/api/stellar-solutions/payment-mode/index.js +115 -49
  29. package/api/stellar-solutions/preference/index.d.ts +14 -3
  30. package/api/stellar-solutions/preference/index.js +44 -14
  31. package/api/stellar-solutions/product/index.d.ts +46 -31
  32. package/api/stellar-solutions/product/index.js +142 -113
  33. package/api/stellar-solutions/product-category/index.d.ts +44 -27
  34. package/api/stellar-solutions/product-category/index.js +123 -87
  35. package/api/stellar-solutions/profile/index.d.ts +48 -17
  36. package/api/stellar-solutions/profile/index.js +124 -65
  37. package/api/stellar-solutions/quote-invoice/index.d.ts +67 -8
  38. package/api/stellar-solutions/quote-invoice/index.js +123 -57
  39. package/api/stellar-solutions/quote-invoice-report/index.d.ts +12 -5
  40. package/api/stellar-solutions/quote-invoice-report/index.js +10 -5
  41. package/api/stellar-solutions/tax/index.d.ts +46 -14
  42. package/api/stellar-solutions/tax/index.js +135 -63
  43. package/api/stellar-solutions/type.d.ts +292 -177
  44. package/api/stellar-solutions/type.js +93 -1
  45. package/constants/countries-timezones.js +0 -1
  46. package/constants/currencies.js +0 -1
  47. package/general/basic-get.js +22 -21
  48. package/general/basic-post.js +19 -18
  49. package/general/calculate-pages.js +3 -1
  50. package/general/check-even-odd-length.js +3 -2
  51. package/general/delete-image-from-private-supabase.js +0 -1
  52. package/general/delete-image-from-public-supabase.js +0 -1
  53. package/general/dynamic-page-limit.js +3 -2
  54. package/general/enum-to-text.js +7 -4
  55. package/general/fetch-data.js +0 -1
  56. package/general/fetch-supabase-image.js +0 -1
  57. package/general/fetch-supabase-private-assets.js +15 -14
  58. package/general/format-date.js +8 -8
  59. package/general/format-number.js +3 -2
  60. package/general/format-time.js +3 -2
  61. package/general/full-year-range.js +2 -2
  62. package/general/generate-blog-schema.d.ts +3 -3
  63. package/general/generate-blog-schema.js +20 -13
  64. package/general/generate-breadcrumb-schema.d.ts +4 -4
  65. package/general/generate-breadcrumb-schema.js +9 -10
  66. package/general/generate-faq-schema.d.ts +5 -5
  67. package/general/generate-faq-schema.js +18 -11
  68. package/general/generate-grid.js +0 -1
  69. package/general/generate-organization-schema.d.ts +3 -3
  70. package/general/generate-organization-schema.js +25 -18
  71. package/general/get-available-page-limit.js +2 -2
  72. package/general/get-calendar-dates.js +14 -3
  73. package/general/get-full-name.d.ts +1 -1
  74. package/general/get-number-of-days-in-month.d.ts +1 -1
  75. package/general/get-pathname.js +4 -1
  76. package/general/is-odd.js +1 -1
  77. package/general/is-previous-button-disabled.js +3 -1
  78. package/general/parse-frontmatter.js +0 -1
  79. package/general/remove-data-image-prefix.js +3 -2
  80. package/general/repeat-times.js +0 -1
  81. package/general/resolve-current-date.js +1 -2
  82. package/general/resolve-grid.js +3 -2
  83. package/general/slugify.js +11 -9
  84. package/general/text-to-enum.js +6 -1
  85. package/general/text-to-sentence-case.js +3 -1
  86. package/general/time-out.js +5 -4
  87. package/general/truncate-text.js +3 -1
  88. package/general/upload-blob-to-private-supabase.js +2 -2
  89. package/general/upload-blob-to-public-supabase.js +2 -2
  90. package/general/upload-image-to-private-supabase.js +2 -2
  91. package/general/upload-image-to-public-supabase.js +2 -2
  92. package/general/validate-email.js +1 -1
  93. package/hooks/use-fetch.js +11 -12
  94. package/hooks/use-module-entity.js +5 -6
  95. package/hooks/use-sticky.js +0 -1
  96. package/hooks/with-seo.d.ts +1 -1
  97. package/hooks/with-seo.js +3 -4
  98. package/local-storage/get-storage-value.js +0 -1
  99. package/package.json +22 -13
  100. package/setupTests.js +1 -2
  101. package/storybook/generate-sitemap.js +0 -1
  102. package/storybook/preview.js +1 -4
  103. package/storybook/react-design-story-script.js +0 -2
  104. package/storybook/react-emoji-collection.js +8 -6
  105. package/storybook/react-emoji-story-script.js +0 -2
  106. package/storybook/react-icon-collection.js +4 -3
  107. package/storybook/react-icon-story-script.js +0 -2
  108. package/storybook/react-logo-collection.js +4 -3
  109. package/storybook/react-logo-story-script.js +0 -2
  110. package/storybook/responsive-component.js +14 -7
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __assign = (this && this.__assign) || function () {
4
3
  __assign = Object.assign || function(t) {
5
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -58,25 +57,27 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
58
57
  };
59
58
  Object.defineProperty(exports, "__esModule", { value: true });
60
59
  exports.basicGet = void 0;
61
- var basicGet = function (url) { return function () {
62
- var args_1 = [];
63
- for (var _i = 0; _i < arguments.length; _i++) {
64
- args_1[_i] = arguments[_i];
65
- }
66
- return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (opts) {
67
- var headers, response;
68
- if (opts === void 0) { opts = {}; }
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0:
72
- headers = opts.headers ? opts.headers : {};
73
- headers['Content-Type'] = 'application/json';
74
- return [4 /*yield*/, fetch(url, __assign({ headers: headers, method: 'GET' }, opts))];
75
- case 1:
76
- response = _a.sent();
77
- return [2 /*return*/, response.json()];
78
- }
60
+ var basicGet = function (url) {
61
+ return function () {
62
+ var args_1 = [];
63
+ for (var _i = 0; _i < arguments.length; _i++) {
64
+ args_1[_i] = arguments[_i];
65
+ }
66
+ return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (opts) {
67
+ var headers, response;
68
+ if (opts === void 0) { opts = {}; }
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ headers = opts.headers ? opts.headers : {};
73
+ headers['Content-Type'] = 'application/json';
74
+ return [4 /*yield*/, fetch(url, __assign({ headers: headers, method: 'GET' }, opts))];
75
+ case 1:
76
+ response = _a.sent();
77
+ return [2 /*return*/, response.json()];
78
+ }
79
+ });
79
80
  });
80
- });
81
- }; };
81
+ };
82
+ };
82
83
  exports.basicGet = basicGet;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __assign = (this && this.__assign) || function () {
4
3
  __assign = Object.assign || function(t) {
5
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -49,21 +48,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
48
  };
50
49
  Object.defineProperty(exports, "__esModule", { value: true });
51
50
  exports.basicPost = void 0;
52
- var basicPost = function (url) { return function (payload, opts) {
53
- if (opts === void 0) { opts = {}; }
54
- return function () { return __awaiter(void 0, void 0, void 0, function () {
55
- var headers, response;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0:
59
- headers = opts.headers ? opts.headers : {};
60
- headers['Content-Type'] = 'application/json';
61
- return [4 /*yield*/, fetch(url, __assign(__assign({ method: 'POST' }, opts), { body: JSON.stringify(payload), headers: headers }))];
62
- case 1:
63
- response = _a.sent();
64
- return [2 /*return*/, response.json()];
65
- }
66
- });
67
- }); };
68
- }; };
51
+ var basicPost = function (url) {
52
+ return function (payload, opts) {
53
+ if (opts === void 0) { opts = {}; }
54
+ return function () { return __awaiter(void 0, void 0, void 0, function () {
55
+ var headers, response;
56
+ return __generator(this, function (_a) {
57
+ switch (_a.label) {
58
+ case 0:
59
+ headers = opts.headers ? opts.headers : {};
60
+ headers['Content-Type'] = 'application/json';
61
+ return [4 /*yield*/, fetch(url, __assign(__assign({ method: 'POST' }, opts), { body: JSON.stringify(payload), headers: headers }))];
62
+ case 1:
63
+ response = _a.sent();
64
+ return [2 /*return*/, response.json()];
65
+ }
66
+ });
67
+ }); };
68
+ };
69
+ };
69
70
  exports.basicPost = basicPost;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calculatePages = void 0;
4
- var calculatePages = function (count, pageLimit) { return Math.ceil(count / pageLimit); };
4
+ var calculatePages = function (count, pageLimit) {
5
+ return Math.ceil(count / pageLimit);
6
+ };
5
7
  exports.calculatePages = calculatePages;
@@ -11,6 +11,7 @@
11
11
  /** End file docs */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.checkEvenOddLength = void 0;
14
- /* eslint-disable @typescript-eslint/no-explicit-any */
15
- var checkEvenOddLength = function (arr) { return (arr.length % 2 === 0 ? 2 : 1); };
14
+ var checkEvenOddLength = function (arr) {
15
+ return arr.length % 2 === 0 ? 2 : 1;
16
+ };
16
17
  exports.checkEvenOddLength = checkEvenOddLength;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dynamicPageLimit = void 0;
4
- var dynamicPageLimit = function (availableOptions) { return availableOptions
5
- .map(function (txt) { return ({ option: String(txt) }); }); };
4
+ var dynamicPageLimit = function (availableOptions) {
5
+ return availableOptions.map(function (txt) { return ({ option: String(txt) }); });
6
+ };
6
7
  exports.dynamicPageLimit = dynamicPageLimit;
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.enumToText = void 0;
4
- var enumToText = function (e) { return e
5
- .toLowerCase()
6
- .split('_')
7
- .map(function (item) { return item.charAt(0).toUpperCase() + item.slice(1); }).join(' '); };
4
+ var enumToText = function (e) {
5
+ return e
6
+ .toLowerCase()
7
+ .split('_')
8
+ .map(function (item) { return item.charAt(0).toUpperCase() + item.slice(1); })
9
+ .join(' ');
10
+ };
8
11
  exports.enumToText = enumToText;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __assign = (this && this.__assign) || function () {
4
3
  __assign = Object.assign || function(t) {
5
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/type-annotation-spacing */
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/type-annotation-spacing */
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -45,19 +44,21 @@ var fetchSupabasePrivateAssets = function (_a) { return __awaiter(void 0, [_a],
45
44
  return __generator(this, function (_c) {
46
45
  switch (_c.label) {
47
46
  case 0:
48
- fetchPromises = fetchUrls.map(function (url) { return fetch(url, {
49
- method: constants_1.API_METHODS.GET,
50
- headers: {
51
- 'Content-Type': 'application/json',
52
- apikey: apikey,
53
- Authorization: "Bearer ".concat(token),
54
- },
55
- }).then(function (response) {
56
- if (!response.ok) {
57
- throw new Error("HTTP error! status: ".concat(response.status, " from ").concat(url));
58
- }
59
- return response.blob();
60
- }); });
47
+ fetchPromises = fetchUrls.map(function (url) {
48
+ return fetch(url, {
49
+ method: constants_1.API_METHODS.GET,
50
+ headers: {
51
+ 'Content-Type': 'application/json',
52
+ apikey: apikey,
53
+ Authorization: "Bearer ".concat(token),
54
+ },
55
+ }).then(function (response) {
56
+ if (!response.ok) {
57
+ throw new Error("HTTP error! status: ".concat(response.status, " from ").concat(url));
58
+ }
59
+ return response.blob();
60
+ });
61
+ });
61
62
  return [4 /*yield*/, Promise.all(fetchPromises)];
62
63
  case 1:
63
64
  results = _c.sent();
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/indent */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.formatDate = exports.DATE_FORMATS = void 0;
5
4
  var get_day_name_1 = require("./get-day-name");
@@ -17,18 +16,19 @@ var formatDate = function (str, format) {
17
16
  var _b, _c;
18
17
  var dateObj = new Date(str);
19
18
  var cleanMonthNumber = dateObj.getMonth() + 1;
20
- var monthNumberInTwoDigits = String(cleanMonthNumber).length < 2 ? "0".concat(cleanMonthNumber) : cleanMonthNumber;
19
+ var monthNumberInTwoDigits = String(cleanMonthNumber).length < 2
20
+ ? "0".concat(cleanMonthNumber)
21
+ : cleanMonthNumber;
21
22
  var cleanDateNumber = dateObj.getDate();
22
- var dateNumberInTowDigits = String(cleanDateNumber).length < 2 ? "0".concat(cleanDateNumber) : cleanDateNumber;
23
+ var dateNumberInTowDigits = String(cleanDateNumber).length < 2
24
+ ? "0".concat(cleanDateNumber)
25
+ : cleanDateNumber;
23
26
  var dateMap = (_a = {},
24
27
  _a[DATE_FORMATS.LOCALE_DATE] = dateObj.toLocaleDateString(),
25
28
  _a[DATE_FORMATS.DD_MM] = "".concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth())),
26
29
  _a[DATE_FORMATS.YYYY_MM_DD] = "".concat(dateObj.getFullYear(), "-").concat(monthNumberInTwoDigits, "-").concat(dateNumberInTowDigits),
27
- _a[DATE_FORMATS.DAY_DD_MM_YYYY] = "".concat((0, get_day_name_1.getDayName)(dateObj
28
- .getDay()), ", ").concat(dateObj
29
- .getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth()), " ").concat(dateObj.getFullYear()),
30
- _a[DATE_FORMATS.DAY_DD_MM_YY_COMPACT] = "".concat((_b = (0, get_day_name_1.getDayName)(dateObj.getDay())) === null || _b === void 0 ? void 0 : _b.slice(0, 3), ", ").concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj
31
- .getMonth()), " ").concat((_c = String(dateObj.getFullYear())) === null || _c === void 0 ? void 0 : _c.slice(2, 5)),
30
+ _a[DATE_FORMATS.DAY_DD_MM_YYYY] = "".concat((0, get_day_name_1.getDayName)(dateObj.getDay()), ", ").concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth()), " ").concat(dateObj.getFullYear()),
31
+ _a[DATE_FORMATS.DAY_DD_MM_YY_COMPACT] = "".concat((_b = (0, get_day_name_1.getDayName)(dateObj.getDay())) === null || _b === void 0 ? void 0 : _b.slice(0, 3), ", ").concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth()), " ").concat((_c = String(dateObj.getFullYear())) === null || _c === void 0 ? void 0 : _c.slice(2, 5)),
32
32
  _a);
33
33
  return dateMap[format];
34
34
  };
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any, prefer-exponentiation-operator, no-restricted-properties */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.formatNumber = void 0;
5
4
  var formatNumber = function (input, options) {
@@ -21,7 +20,9 @@ var formatNumber = function (input, options) {
21
20
  // Find magnitude
22
21
  var tier = Math.floor(Math.log10(absNumber) / 3);
23
22
  if (tier === 0) {
24
- var formatted_1 = useLocale ? absNumber.toLocaleString() : absNumber.toFixed(decimals);
23
+ var formatted_1 = useLocale
24
+ ? absNumber.toLocaleString()
25
+ : absNumber.toFixed(decimals);
25
26
  return sign + formatted_1;
26
27
  }
27
28
  var suffix = suffixes[tier] || "e".concat(tier * 3);
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable no-restricted-syntax */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.formatDuration = void 0;
5
4
  var units = [
@@ -11,7 +10,9 @@ var units = [
11
10
  var formatDuration = function (_a) {
12
11
  var seconds = _a.seconds;
13
12
  /* Edge Case Handling */
14
- if (typeof seconds !== 'number' || seconds < 0 || !Number.isInteger(seconds)) {
13
+ if (typeof seconds !== 'number' ||
14
+ seconds < 0 ||
15
+ !Number.isInteger(seconds)) {
15
16
  throw new Error('Invalid input: must be a non-negative integer');
16
17
  }
17
18
  var remaining = seconds;
@@ -5,9 +5,9 @@ var fullYearRange = function () {
5
5
  var currentYear = new Date().getFullYear();
6
6
  var startOfYear = new Date(currentYear, 0, 1); // January 1st of the current year
7
7
  var endOfYear = new Date(currentYear, 11, 31, 23, 59, 59, 999); // December 31st, end of day
8
- return ({
8
+ return {
9
9
  startOfYear: startOfYear,
10
10
  endOfYear: endOfYear,
11
- });
11
+ };
12
12
  };
13
13
  exports.fullYearRange = fullYearRange;
@@ -17,8 +17,8 @@ interface Blog {
17
17
  url: string;
18
18
  }
19
19
  export declare const generateBlogSchema: ({ authorImage, authorName, banner, createdAt, excerpt, title, updatedAt, url, }: Blog) => {
20
- "@context": string;
21
- "@type": string;
20
+ '@context': string;
21
+ '@type': string;
22
22
  headline: string;
23
23
  dateModified: string;
24
24
  datePublished: string;
@@ -26,7 +26,7 @@ export declare const generateBlogSchema: ({ authorImage, authorName, banner, cre
26
26
  image: string;
27
27
  url: string;
28
28
  author: {
29
- "@type": string;
29
+ '@type': string;
30
30
  name: string;
31
31
  url: string;
32
32
  };
@@ -1,22 +1,29 @@
1
1
  "use strict";
2
- /* eslint-disable */
2
+ /**
3
+ * A util function to create Rich Schema for FAQ
4
+ *
5
+ * @returns formatted date - Saturday, 11/01/2020
6
+ * @author Taimoor Khan
7
+ * @remarks AppCorp
8
+ */
9
+ /** End file docs */
3
10
  Object.defineProperty(exports, "__esModule", { value: true });
4
11
  exports.generateBlogSchema = void 0;
5
12
  var generateBlogSchema = function (_a) {
6
13
  var authorImage = _a.authorImage, authorName = _a.authorName, banner = _a.banner, createdAt = _a.createdAt, excerpt = _a.excerpt, title = _a.title, updatedAt = _a.updatedAt, url = _a.url;
7
14
  return {
8
- "@context": "https://schema.org",
9
- "@type": "BlogPosting",
10
- "headline": "".concat(title),
11
- "dateModified": "".concat(updatedAt),
12
- "datePublished": "".concat(createdAt),
13
- "description": "".concat(excerpt),
14
- "image": "".concat(banner),
15
- "url": "".concat(url),
16
- "author": {
17
- "@type": "Person",
18
- "name": "".concat(authorName),
19
- "url": "".concat(authorImage),
15
+ '@context': 'https://schema.org',
16
+ '@type': 'BlogPosting',
17
+ headline: "".concat(title),
18
+ dateModified: "".concat(updatedAt),
19
+ datePublished: "".concat(createdAt),
20
+ description: "".concat(excerpt),
21
+ image: "".concat(banner),
22
+ url: "".concat(url),
23
+ author: {
24
+ '@type': 'Person',
25
+ name: "".concat(authorName),
26
+ url: "".concat(authorImage),
20
27
  },
21
28
  };
22
29
  };
@@ -10,11 +10,11 @@ interface Props {
10
10
  data: Array<string>;
11
11
  baseUrl: string;
12
12
  }
13
- export declare const generateBreadcrumbSchema: ({ data, baseUrl, }: Props) => {
14
- "@context": string;
15
- "@type": string;
13
+ export declare const generateBreadcrumbSchema: ({ data, baseUrl }: Props) => {
14
+ '@context': string;
15
+ '@type': string;
16
16
  itemListElement: {
17
- "@type": string;
17
+ '@type': string;
18
18
  position: number;
19
19
  name: string;
20
20
  item: string;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.generateBreadcrumbSchema = void 0;
5
4
  var slugify_1 = require("./slugify");
@@ -8,17 +7,17 @@ var generateBreadcrumbSchema = function (_a) {
8
7
  var urlItem = baseUrl;
9
8
  var items = data.map(function (text, index) {
10
9
  urlItem += "/".concat((0, slugify_1.slugify)(text));
11
- return ({
12
- "@type": "ListItem",
13
- "position": index + 1,
14
- "name": text,
15
- "item": urlItem,
16
- });
10
+ return {
11
+ '@type': 'ListItem',
12
+ position: index + 1,
13
+ name: text,
14
+ item: urlItem,
15
+ };
17
16
  });
18
17
  return {
19
- "@context": "https://schema.org",
20
- "@type": "BreadcrumbList",
21
- "itemListElement": items,
18
+ '@context': 'https://schema.org',
19
+ '@type': 'BreadcrumbList',
20
+ itemListElement: items,
22
21
  };
23
22
  };
24
23
  exports.generateBreadcrumbSchema = generateBreadcrumbSchema;
@@ -12,14 +12,14 @@ interface FAQ {
12
12
  question: string;
13
13
  }>;
14
14
  }
15
- export declare const generateFAQSchema: ({ data, }: FAQ) => {
16
- "@context": string;
17
- "@type": string;
15
+ export declare const generateFAQSchema: ({ data }: FAQ) => {
16
+ '@context': string;
17
+ '@type': string;
18
18
  mainEntity: {
19
- "@type": string;
19
+ '@type': string;
20
20
  name: string;
21
21
  acceptedAnswer: {
22
- "@type": string;
22
+ '@type': string;
23
23
  text: string;
24
24
  };
25
25
  }[];
@@ -1,24 +1,31 @@
1
1
  "use strict";
2
- /* eslint-disable */
2
+ /**
3
+ * A util function to create Rich Schema for FAQ
4
+ *
5
+ * @returns formatted date - Saturday, 11/01/2020
6
+ * @author Taimoor Khan
7
+ * @remarks AppCorp
8
+ */
9
+ /** End file docs */
3
10
  Object.defineProperty(exports, "__esModule", { value: true });
4
11
  exports.generateFAQSchema = void 0;
5
12
  var generateFAQSchema = function (_a) {
6
13
  var data = _a.data;
7
14
  var items = data.map(function (_a) {
8
15
  var answer = _a.answer, question = _a.question;
9
- return ({
10
- "@type": "Question",
11
- "name": question,
12
- "acceptedAnswer": {
13
- "@type": "Answer",
14
- "text": "<p>".concat(answer, "</p>")
16
+ return {
17
+ '@type': 'Question',
18
+ name: question,
19
+ acceptedAnswer: {
20
+ '@type': 'Answer',
21
+ text: "<p>".concat(answer, "</p>"),
15
22
  },
16
- });
23
+ };
17
24
  });
18
25
  return {
19
- "@context": "https://schema.org",
20
- "@type": "FAQPage",
21
- "mainEntity": items,
26
+ '@context': 'https://schema.org',
27
+ '@type': 'FAQPage',
28
+ mainEntity: items,
22
29
  };
23
30
  };
24
31
  exports.generateFAQSchema = generateFAQSchema;
@@ -11,7 +11,6 @@
11
11
  /** End file docs */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.generateGrid = void 0;
14
- /* eslint-disable @typescript-eslint/no-explicit-any */
15
14
  var generateGrid = function (array) {
16
15
  var gridMap = {
17
16
  1: {
@@ -22,8 +22,8 @@ interface Organization {
22
22
  telephone: string;
23
23
  }
24
24
  export declare const generateOrganizationSchema: ({ addressCountry, addressLocality, addressRegion, appName, baseUrl, description, email, image, logo, postalCode, sameAsArr, streetAddress, telephone, }: Organization) => {
25
- "@context": string;
26
- "@type": string;
25
+ '@context': string;
26
+ '@type': string;
27
27
  image: string;
28
28
  url: string;
29
29
  sameAs: string[];
@@ -33,7 +33,7 @@ export declare const generateOrganizationSchema: ({ addressCountry, addressLocal
33
33
  email: string;
34
34
  telephone: string;
35
35
  address: {
36
- "@type": string;
36
+ '@type': string;
37
37
  streetAddress: string;
38
38
  addressLocality: string;
39
39
  addressCountry: string;
@@ -1,27 +1,34 @@
1
1
  "use strict";
2
- /* eslint-disable */
2
+ /**
3
+ * A util function to create Rich Schema for Organization
4
+ *
5
+ * @returns formatted date - Saturday, 11/01/2020
6
+ * @author Taimoor Khan
7
+ * @remarks AppCorp
8
+ */
9
+ /** End file docs */
3
10
  Object.defineProperty(exports, "__esModule", { value: true });
4
11
  exports.generateOrganizationSchema = void 0;
5
12
  var generateOrganizationSchema = function (_a) {
6
13
  var addressCountry = _a.addressCountry, addressLocality = _a.addressLocality, addressRegion = _a.addressRegion, appName = _a.appName, baseUrl = _a.baseUrl, description = _a.description, email = _a.email, image = _a.image, logo = _a.logo, postalCode = _a.postalCode, sameAsArr = _a.sameAsArr, streetAddress = _a.streetAddress, telephone = _a.telephone;
7
14
  return {
8
- "@context": "https://schema.org",
9
- "@type": "Organization",
10
- "image": "".concat(image),
11
- "url": "".concat(baseUrl),
12
- "sameAs": sameAsArr,
13
- "logo": "".concat(logo),
14
- "name": "".concat(appName),
15
- "description": "".concat(description),
16
- "email": "".concat(email),
17
- "telephone": "".concat(telephone),
18
- "address": {
19
- "@type": "PostalAddress",
20
- "streetAddress": "".concat(streetAddress),
21
- "addressLocality": "".concat(addressLocality),
22
- "addressCountry": "".concat(addressCountry),
23
- "addressRegion": "".concat(addressRegion),
24
- "postalCode": "".concat(postalCode),
15
+ '@context': 'https://schema.org',
16
+ '@type': 'Organization',
17
+ image: "".concat(image),
18
+ url: "".concat(baseUrl),
19
+ sameAs: sameAsArr,
20
+ logo: "".concat(logo),
21
+ name: "".concat(appName),
22
+ description: "".concat(description),
23
+ email: "".concat(email),
24
+ telephone: "".concat(telephone),
25
+ address: {
26
+ '@type': 'PostalAddress',
27
+ streetAddress: "".concat(streetAddress),
28
+ addressLocality: "".concat(addressLocality),
29
+ addressCountry: "".concat(addressCountry),
30
+ addressRegion: "".concat(addressRegion),
31
+ postalCode: "".concat(postalCode),
25
32
  },
26
33
  };
27
34
  };
@@ -14,9 +14,9 @@ var dynamic_page_limit_1 = require("./dynamic-page-limit");
14
14
  var getAvailablePageLimits = function (totalRecords) {
15
15
  var allOptions = [5, 10, 15, 25, 100];
16
16
  // Get options less than or equal to totalRecords
17
- var lowerOptions = allOptions.filter(function (opt) { return (opt < totalRecords); });
17
+ var lowerOptions = allOptions.filter(function (opt) { return opt < totalRecords; });
18
18
  // Find the next higher option
19
- var nextHigherOption = allOptions.find(function (opt) { return (opt >= totalRecords); });
19
+ var nextHigherOption = allOptions.find(function (opt) { return opt >= totalRecords; });
20
20
  // Combine lower options and next higher (if it exists)
21
21
  var availableOptions = __spreadArray([], lowerOptions, true);
22
22
  if (nextHigherOption && !availableOptions.includes(nextHigherOption)) {
@@ -22,9 +22,20 @@ dayjs_1.default.extend(weekday_1.default);
22
22
  var getCalendarDates = function (_a) {
23
23
  var month = _a.month, year = _a.year;
24
24
  var updatedMonth = month + 1;
25
- var currentMonthDays = (0, get_calendar_current_month_1.getCalendarCurrentMonth)({ month: updatedMonth, year: year });
26
- var previousMonthDays = (0, get_calendar_previous_month_1.getCalendarPreviousMonth)({ currentMonthDays: currentMonthDays, month: updatedMonth, year: year });
27
- var nextMonthDays = (0, get_calendar_next_month_1.getCalendarNextMonth)({ currentMonthDays: currentMonthDays, month: updatedMonth, year: year });
25
+ var currentMonthDays = (0, get_calendar_current_month_1.getCalendarCurrentMonth)({
26
+ month: updatedMonth,
27
+ year: year,
28
+ });
29
+ var previousMonthDays = (0, get_calendar_previous_month_1.getCalendarPreviousMonth)({
30
+ currentMonthDays: currentMonthDays,
31
+ month: updatedMonth,
32
+ year: year,
33
+ });
34
+ var nextMonthDays = (0, get_calendar_next_month_1.getCalendarNextMonth)({
35
+ currentMonthDays: currentMonthDays,
36
+ month: updatedMonth,
37
+ year: year,
38
+ });
28
39
  var days = __spreadArray(__spreadArray(__spreadArray([], previousMonthDays, true), currentMonthDays, true), nextMonthDays, true);
29
40
  return days;
30
41
  };
@@ -2,5 +2,5 @@ interface Params {
2
2
  firstName: string;
3
3
  lastName: string;
4
4
  }
5
- export declare const getFullName: ({ firstName, lastName, }: Params) => string;
5
+ export declare const getFullName: ({ firstName, lastName }: Params) => string;
6
6
  export {};
@@ -2,5 +2,5 @@ interface Params {
2
2
  year: number;
3
3
  month: number;
4
4
  }
5
- export declare const getNumberOfDaysInMonth: ({ year, month, }: Params) => number;
5
+ export declare const getNumberOfDaysInMonth: ({ year, month }: Params) => number;
6
6
  export {};
@@ -9,5 +9,8 @@
9
9
  /** End file docs */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.getPathname = void 0;
12
- var getPathname = function () { return (window && window.location.pathname.substring(0, window.location.pathname.length - 1)); };
12
+ var getPathname = function () {
13
+ return window &&
14
+ window.location.pathname.substring(0, window.location.pathname.length - 1);
15
+ };
13
16
  exports.getPathname = getPathname;