@react-pakistan/util-functions 1.25.90 → 2.0.0
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/README.md +74 -315
- package/constants/api-methods.d.ts +3 -1
- package/constants/api-methods.js +1 -15
- package/constants/cache-time.d.ts +7 -5
- package/constants/cache-time.js +1 -8
- package/constants/countries-timezones.d.ts +4 -2
- package/constants/countries-timezones.js +1 -1411
- package/constants/currencies.d.ts +4 -2
- package/constants/currencies.js +1 -1076
- package/constants/dial-codes.d.ts +5 -3
- package/constants/dial-codes.js +1 -1216
- package/constants/layout-direction.d.ts +3 -1
- package/constants/layout-direction.js +1 -8
- package/constants/react-pakistan-meta.d.ts +4 -2
- package/constants/react-pakistan-meta.js +1 -35
- package/constants/react-pakistan.d.ts +5 -3
- package/constants/react-pakistan.js +12 -104
- package/constants/select-value-delimiter.d.ts +3 -1
- package/constants/select-value-delimiter.js +1 -13
- package/constants/social-media-colors.d.ts +3 -1
- package/constants/social-media-colors.js +1 -42
- package/constants/social-media-sizes.d.ts +6 -4
- package/constants/social-media-sizes.js +1 -327
- package/constants/user-roles.d.ts +3 -1
- package/constants/user-roles.js +1 -9
- package/edu-pilot-pro/types/academics.d.ts +2 -266
- package/edu-pilot-pro/types/academics.js +1 -9
- package/edu-pilot-pro/types/admission.d.ts +803 -10
- package/edu-pilot-pro/types/admission.js +1 -7
- package/edu-pilot-pro/types/communication.d.ts +2 -165
- package/edu-pilot-pro/types/communication.js +1 -8
- package/edu-pilot-pro/types/enums.d.ts +30 -28
- package/edu-pilot-pro/types/enums.js +1 -445
- package/edu-pilot-pro/types/finance.d.ts +2 -128
- package/edu-pilot-pro/types/finance.js +1 -8
- package/edu-pilot-pro/types/index.d.ts +2 -12
- package/edu-pilot-pro/types/index.js +1 -28
- package/edu-pilot-pro/types/user-management.d.ts +2 -236
- package/edu-pilot-pro/types/user-management.js +1 -8
- package/factory/generic-component-factory.d.ts +12 -9
- package/factory/generic-component-factory.js +1 -131
- package/factory/generic-module-factory.d.ts +14 -10
- package/factory/generic-module-factory.js +1 -190
- package/general/basic-get.d.ts +8 -1
- package/general/basic-get.js +1 -83
- package/general/basic-post.d.ts +8 -1
- package/general/basic-post.js +1 -70
- package/general/calculate-pages.d.ts +9 -1
- package/general/calculate-pages.js +1 -7
- package/general/camel-to-sentence-case.d.ts +3 -1
- package/general/camel-to-sentence-case.js +1 -20
- package/general/check-even-odd-length.d.ts +3 -1
- package/general/check-even-odd-length.js +1 -17
- package/general/clear-cache.d.ts +7 -2
- package/general/clear-cache.js +1 -12
- package/general/cnic-formatter.d.ts +16 -3
- package/general/cnic-formatter.js +1 -53
- package/general/convert-url-to-base64.d.ts +8 -6
- package/general/convert-url-to-base64.js +1 -231
- package/general/countries.d.ts +5 -3
- package/general/countries.js +1 -514
- package/general/create-date.d.ts +3 -1
- package/general/create-date.js +1 -22
- package/general/crypto.d.ts +4 -2
- package/general/crypto.js +1 -45
- package/general/currencies.d.ts +2 -0
- package/general/currencies.js +0 -1077
- package/general/delete-image-from-private-supabase.d.ts +10 -2
- package/general/delete-image-from-private-supabase.js +1 -66
- package/general/delete-image-from-public-supabase.d.ts +10 -2
- package/general/delete-image-from-public-supabase.js +1 -66
- package/general/download-from-url.d.ts +8 -1
- package/general/download-from-url.js +1 -82
- package/general/dynamic-page-limit.d.ts +9 -3
- package/general/dynamic-page-limit.js +1 -7
- package/general/enum-to-text.d.ts +8 -1
- package/general/enum-to-text.js +1 -11
- package/general/fetch-data.d.ts +16 -4
- package/general/fetch-data.js +1 -95
- package/general/fetch-supabase-image.d.ts +11 -2
- package/general/fetch-supabase-image.js +1 -67
- package/general/fetch-supabase-private-assets.d.ts +11 -2
- package/general/fetch-supabase-private-assets.js +1 -69
- package/general/format-date.d.ts +10 -2
- package/general/format-date.js +1 -49
- package/general/format-number.d.ts +12 -2
- package/general/format-number.js +1 -35
- package/general/format-phone-display.d.ts +9 -1
- package/general/format-phone-display.js +1 -32
- package/general/format-phone.d.ts +10 -2
- package/general/format-phone.js +1 -20
- package/general/format-pricing.d.ts +8 -1
- package/general/format-pricing.js +1 -23
- package/general/format-secs.d.ts +8 -1
- package/general/format-secs.js +1 -21
- package/general/format-time.d.ts +8 -2
- package/general/format-time.js +1 -38
- package/general/format-value.d.ts +8 -1
- package/general/format-value.js +1 -7
- package/general/full-month-range.d.ts +3 -2
- package/general/full-month-range.js +1 -24
- package/general/full-year-range.d.ts +3 -2
- package/general/full-year-range.js +1 -20
- package/general/generate-article-schema.d.ts +3 -2
- package/general/generate-article-schema.js +1 -100
- package/general/generate-blog-schema.d.ts +3 -2
- package/general/generate-blog-schema.js +1 -32
- package/general/generate-book-schema.d.ts +3 -2
- package/general/generate-book-schema.js +1 -109
- package/general/generate-breadcrumb-schema.d.ts +3 -2
- package/general/generate-breadcrumb-schema.js +1 -34
- package/general/generate-carousel-schema.d.ts +3 -2
- package/general/generate-carousel-schema.js +1 -172
- package/general/generate-course-schema.d.ts +3 -2
- package/general/generate-course-schema.js +1 -124
- package/general/generate-dataset-schema.d.ts +3 -2
- package/general/generate-dataset-schema.js +1 -156
- package/general/generate-discussion-forum-schema.d.ts +3 -2
- package/general/generate-discussion-forum-schema.js +1 -67
- package/general/generate-education-schema.d.ts +3 -2
- package/general/generate-education-schema.js +1 -137
- package/general/generate-employer-aggregate-rating-schema.d.ts +3 -2
- package/general/generate-employer-aggregate-rating-schema.js +1 -64
- package/general/generate-event-schema.d.ts +3 -2
- package/general/generate-event-schema.js +1 -214
- package/general/generate-faq-schema.d.ts +3 -2
- package/general/generate-faq-schema.js +1 -43
- package/general/generate-grid.d.ts +3 -2
- package/general/generate-grid.js +1 -55
- package/general/generate-image-metadata-schema.d.ts +3 -2
- package/general/generate-image-metadata-schema.js +1 -73
- package/general/generate-job-posting-schema.d.ts +3 -2
- package/general/generate-job-posting-schema.js +1 -120
- package/general/generate-local-business-schema.d.ts +3 -2
- package/general/generate-local-business-schema.js +1 -75
- package/general/generate-math-solver-schema.d.ts +3 -2
- package/general/generate-math-solver-schema.js +1 -83
- package/general/generate-movie-carousel-schema.d.ts +3 -2
- package/general/generate-movie-carousel-schema.js +1 -160
- package/general/generate-organization-schema.d.ts +3 -2
- package/general/generate-organization-schema.js +1 -39
- package/general/generate-profile-page-schema.d.ts +3 -2
- package/general/generate-profile-page-schema.js +1 -82
- package/general/generate-qa-page-schema.d.ts +3 -2
- package/general/generate-qa-page-schema.js +1 -67
- package/general/generate-recipe-schema.d.ts +3 -2
- package/general/generate-recipe-schema.js +1 -104
- package/general/generate-ref.d.ts +8 -2
- package/general/generate-ref.js +1 -12
- package/general/generate-review-snippet-schema.d.ts +3 -2
- package/general/generate-review-snippet-schema.js +1 -137
- package/general/generate-shopping-loyalty-program-schema.d.ts +3 -2
- package/general/generate-shopping-loyalty-program-schema.js +1 -59
- package/general/generate-shopping-merchant-listing-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-listing-schema.js +1 -153
- package/general/generate-shopping-merchant-return-policy-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-return-policy-schema.js +1 -68
- package/general/generate-shopping-merchant-shipping-policy-schema.d.ts +3 -2
- package/general/generate-shopping-merchant-shipping-policy-schema.js +1 -74
- package/general/generate-shopping-overview-schema.d.ts +3 -2
- package/general/generate-shopping-overview-schema.js +1 -157
- package/general/generate-shopping-product-snippet-schema.d.ts +3 -2
- package/general/generate-shopping-product-snippet-schema.js +1 -167
- package/general/generate-shopping-variants-schema.d.ts +3 -2
- package/general/generate-shopping-variants-schema.js +1 -143
- package/general/generate-software-app-schema.d.ts +3 -2
- package/general/generate-software-app-schema.js +1 -143
- package/general/generate-speakable-schema.d.ts +3 -2
- package/general/generate-speakable-schema.js +1 -139
- package/general/generate-subscription-schema.d.ts +3 -2
- package/general/generate-subscription-schema.js +1 -133
- package/general/generate-vacation-rental-schema.d.ts +3 -2
- package/general/generate-vacation-rental-schema.js +1 -135
- package/general/generate-video-schema.d.ts +3 -2
- package/general/generate-video-schema.js +1 -163
- package/general/generic-cache.d.ts +17 -15
- package/general/generic-cache.js +1 -659
- package/general/get-available-page-limit.d.ts +8 -2
- package/general/get-available-page-limit.js +1 -31
- package/general/get-calendar-current-month.d.ts +11 -3
- package/general/get-calendar-current-month.js +1 -31
- package/general/get-calendar-dates.d.ts +11 -3
- package/general/get-calendar-dates.js +1 -42
- package/general/get-calendar-next-month.d.ts +12 -3
- package/general/get-calendar-next-month.js +1 -32
- package/general/get-calendar-previous-month.d.ts +12 -3
- package/general/get-calendar-previous-month.js +1 -36
- package/general/get-current-year.d.ts +7 -1
- package/general/get-current-year.js +1 -5
- package/general/get-day-name.d.ts +5 -3
- package/general/get-day-name.js +1 -14
- package/general/get-dial-code.d.ts +8 -1
- package/general/get-dial-code.js +1 -8
- package/general/get-full-name.d.ts +9 -2
- package/general/get-full-name.js +1 -8
- package/general/get-href.d.ts +3 -1
- package/general/get-href.js +1 -13
- package/general/get-month-name.d.ts +5 -3
- package/general/get-month-name.js +1 -19
- package/general/get-month-number.d.ts +5 -3
- package/general/get-month-number.js +1 -29
- package/general/get-number-of-days-in-month.d.ts +9 -2
- package/general/get-number-of-days-in-month.js +1 -12
- package/general/get-pathname.d.ts +3 -1
- package/general/get-pathname.js +1 -16
- package/general/get-week-day.d.ts +8 -1
- package/general/get-week-day.js +1 -9
- package/general/image-url-to-base64.d.ts +3 -1
- package/general/image-url-to-base64.js +1 -80
- package/general/is-created-or-updated.d.ts +3 -1
- package/general/is-created-or-updated.js +1 -26
- package/general/is-next-button-disabled.d.ts +9 -1
- package/general/is-next-button-disabled.js +1 -5
- package/general/is-odd.d.ts +3 -1
- package/general/is-odd.js +1 -13
- package/general/is-previous-button-disabled.d.ts +8 -1
- package/general/is-previous-button-disabled.js +1 -7
- package/general/linear-gradients.d.ts +4 -2
- package/general/linear-gradients.js +1 -52
- package/general/multi-part-search.d.ts +10 -2
- package/general/multi-part-search.js +1 -16
- package/general/normalize-phone.d.ts +15 -2
- package/general/normalize-phone.js +1 -40
- package/general/parse-frontmatter.d.ts +11 -4
- package/general/parse-frontmatter.js +2 -35
- package/general/remove-data-image-prefix.d.ts +8 -1
- package/general/remove-data-image-prefix.js +1 -7
- package/general/repeat-times.d.ts +3 -1
- package/general/repeat-times.js +1 -21
- package/general/resolve-anchor-link.d.ts +3 -1
- package/general/resolve-anchor-link.js +1 -26
- package/general/resolve-current-date.d.ts +3 -1
- package/general/resolve-current-date.js +1 -22
- package/general/resolve-grid.d.ts +3 -1
- package/general/resolve-grid.js +1 -18
- package/general/resolve-initials.d.ts +3 -1
- package/general/resolve-initials.js +1 -17
- package/general/set-timezone.d.ts +11 -1
- package/general/set-timezone.js +1 -12
- package/general/slugify.d.ts +3 -1
- package/general/slugify.js +1 -24
- package/general/text-to-enum.d.ts +8 -1
- package/general/text-to-enum.js +1 -10
- package/general/text-to-sentence-case.d.ts +3 -1
- package/general/text-to-sentence-case.js +1 -16
- package/general/time-out.d.ts +3 -1
- package/general/time-out.js +1 -16
- package/general/time-zones.d.ts +3 -1
- package/general/time-zones.js +1 -437
- package/general/truncate-text.d.ts +3 -1
- package/general/truncate-text.js +1 -18
- package/general/type.d.ts +3 -1
- package/general/type.js +1 -2
- package/general/upload-blob-to-private-supabase.d.ts +14 -2
- package/general/upload-blob-to-private-supabase.js +1 -62
- package/general/upload-blob-to-public-supabase.d.ts +14 -2
- package/general/upload-blob-to-public-supabase.js +1 -62
- package/general/upload-image-to-private-supabase.d.ts +15 -3
- package/general/upload-image-to-private-supabase.js +1 -66
- package/general/upload-image-to-public-supabase.d.ts +15 -3
- package/general/upload-image-to-public-supabase.js +1 -66
- package/general/url-to-sentence-case.d.ts +3 -1
- package/general/url-to-sentence-case.js +1 -19
- package/general/validate-comment.d.ts +3 -1
- package/general/validate-comment.js +1 -21
- package/general/validate-email.d.ts +3 -1
- package/general/validate-email.js +1 -24
- package/general/validate-form.d.ts +12 -3
- package/general/validate-form.js +1 -29
- package/general/validate-name.d.ts +3 -1
- package/general/validate-name.js +1 -21
- package/hooks/use-change.d.ts +11 -2
- package/hooks/use-change.js +1 -23
- package/hooks/use-debounce.d.ts +10 -1
- package/hooks/use-debounce.js +1 -14
- package/hooks/use-fetch.d.ts +7 -5
- package/hooks/use-fetch.js +1 -239
- package/hooks/use-force-render.d.ts +6 -2
- package/hooks/use-force-render.js +1 -17
- package/hooks/use-ip-geo-location.d.ts +8 -1
- package/hooks/use-ip-geo-location.js +1 -79
- package/hooks/use-is-mobile.d.ts +8 -1
- package/hooks/use-is-mobile.js +1 -22
- package/hooks/use-module-entity-v2.d.ts +7 -4
- package/hooks/use-module-entity-v2.js +1 -188
- package/hooks/use-module-entity.d.ts +7 -4
- package/hooks/use-module-entity.js +1 -177
- package/hooks/use-phone-formatter.d.ts +10 -2
- package/hooks/use-phone-formatter.js +1 -23
- package/hooks/use-position.d.ts +6 -3
- package/hooks/use-position.js +1 -43
- package/hooks/use-rtl.d.ts +4 -2
- package/hooks/use-rtl.js +1 -84
- package/hooks/use-sticky.d.ts +3 -1
- package/hooks/use-sticky.js +1 -39
- package/hooks/use-toggle-state.d.ts +3 -2
- package/hooks/use-toggle-state.js +1 -26
- package/hooks/use-window-event-listener.d.ts +9 -1
- package/hooks/use-window-event-listener.js +1 -11
- package/hooks/with-seo.d.ts +11 -2
- package/hooks/with-seo.js +1 -37
- package/local-storage/get-storage-value.d.ts +5 -2
- package/local-storage/get-storage-value.js +1 -20
- package/local-storage/remove-storage-value.d.ts +3 -1
- package/local-storage/remove-storage-value.js +1 -14
- package/local-storage/set-storage-value.d.ts +3 -1
- package/local-storage/set-storage-value.js +1 -14
- package/local-storage/type.d.ts +3 -1
- package/local-storage/type.js +1 -2
- package/npm.d.d.ts +2 -0
- package/npm.d.js +0 -0
- package/package.json +20 -18
- package/storybook/generate-sitemap.d.ts +3 -1
- package/storybook/generate-sitemap.js +17 -26
- package/storybook/preview.d.ts +4 -2
- package/storybook/preview.js +1 -62
- package/storybook/react-design-story-script.d.ts +3 -1
- package/storybook/react-design-story-script.js +5 -27
- package/storybook/react-emoji-collection.d.ts +3 -1
- package/storybook/react-emoji-collection.js +10 -55
- package/storybook/react-emoji-story-script.d.ts +3 -1
- package/storybook/react-emoji-story-script.js +5 -31
- package/storybook/react-emoji-story-template.d.ts +3 -1
- package/storybook/react-emoji-story-template.js +45 -15
- package/storybook/react-icon-collection.d.ts +3 -1
- package/storybook/react-icon-collection.js +10 -42
- package/storybook/react-icon-story-script.d.ts +3 -1
- package/storybook/react-icon-story-script.js +5 -27
- package/storybook/react-icon-story-template.d.ts +3 -1
- package/storybook/react-icon-story-template.js +45 -14
- package/storybook/react-logo-collection.d.ts +3 -1
- package/storybook/react-logo-collection.js +10 -42
- package/storybook/react-logo-story-script.d.ts +3 -1
- package/storybook/react-logo-story-script.js +5 -27
- package/storybook/react-logo-story-template.d.ts +3 -1
- package/storybook/react-logo-story-template.js +45 -14
- package/storybook/react-pakistan-theme.d.ts +3 -1
- package/storybook/react-pakistan-theme.js +1 -31
- package/storybook/responsive-args.d.ts +11 -10
- package/storybook/responsive-args.js +1 -19
- package/storybook/responsive-component.d.ts +4 -2
- package/storybook/responsive-component.js +37 -23
- package/storybook/responsive-screens.d.ts +3 -1
- package/storybook/responsive-screens.js +1 -109
- package/storybook/theme.d.ts +17 -15
- package/storybook/theme.js +1 -1022
- package/api/stellar-solutions/app-user/index.d.ts +0 -51
- package/api/stellar-solutions/app-user/index.js +0 -210
- package/api/stellar-solutions/bank/index.d.ts +0 -59
- package/api/stellar-solutions/bank/index.js +0 -210
- package/api/stellar-solutions/branch/index.d.ts +0 -58
- package/api/stellar-solutions/branch/index.js +0 -220
- package/api/stellar-solutions/company/index.d.ts +0 -57
- package/api/stellar-solutions/company/index.js +0 -218
- package/api/stellar-solutions/company-report/index.d.ts +0 -15
- package/api/stellar-solutions/company-report/index.js +0 -74
- package/api/stellar-solutions/constants.d.ts +0 -19
- package/api/stellar-solutions/constants.js +0 -22
- package/api/stellar-solutions/contact/index.d.ts +0 -56
- package/api/stellar-solutions/contact/index.js +0 -217
- package/api/stellar-solutions/currency/index.d.ts +0 -55
- package/api/stellar-solutions/currency/index.js +0 -212
- package/api/stellar-solutions/customer/index.d.ts +0 -68
- package/api/stellar-solutions/customer/index.js +0 -249
- package/api/stellar-solutions/expense/index.d.ts +0 -58
- package/api/stellar-solutions/expense/index.js +0 -229
- package/api/stellar-solutions/expense-category/index.d.ts +0 -53
- package/api/stellar-solutions/expense-category/index.js +0 -214
- package/api/stellar-solutions/lead/index.d.ts +0 -51
- package/api/stellar-solutions/lead/index.js +0 -206
- package/api/stellar-solutions/menu-order/index.d.ts +0 -53
- package/api/stellar-solutions/menu-order/index.js +0 -202
- package/api/stellar-solutions/payment/index.d.ts +0 -65
- package/api/stellar-solutions/payment/index.js +0 -230
- package/api/stellar-solutions/payment-mode/index.d.ts +0 -53
- package/api/stellar-solutions/payment-mode/index.js +0 -191
- package/api/stellar-solutions/preference/index.d.ts +0 -25
- package/api/stellar-solutions/preference/index.js +0 -114
- package/api/stellar-solutions/product/index.d.ts +0 -64
- package/api/stellar-solutions/product/index.js +0 -235
- package/api/stellar-solutions/product-category/index.d.ts +0 -51
- package/api/stellar-solutions/product-category/index.js +0 -212
- package/api/stellar-solutions/profile/index.d.ts +0 -78
- package/api/stellar-solutions/profile/index.js +0 -234
- package/api/stellar-solutions/quote-invoice/index.d.ts +0 -97
- package/api/stellar-solutions/quote-invoice/index.js +0 -369
- package/api/stellar-solutions/quote-invoice-report/index.d.ts +0 -15
- package/api/stellar-solutions/quote-invoice-report/index.js +0 -74
- package/api/stellar-solutions/tax/index.d.ts +0 -55
- package/api/stellar-solutions/tax/index.js +0 -224
- package/api/stellar-solutions/types/common.d.ts +0 -24
- package/api/stellar-solutions/types/common.js +0 -22
- package/api/stellar-solutions/types/erp.d.ts +0 -302
- package/api/stellar-solutions/types/erp.js +0 -73
- package/api/stellar-solutions/types/index.d.ts +0 -3
- package/api/stellar-solutions/types/index.js +0 -19
- package/api/stellar-solutions/types/pos.d.ts +0 -176
- package/api/stellar-solutions/types/pos.js +0 -61
- package/constants/index.d.ts +0 -12
- package/constants/index.js +0 -28
- package/factory/index.d.ts +0 -2
- package/factory/index.js +0 -18
- package/general/index.d.ts +0 -95
- package/general/index.js +0 -111
- package/index.d.ts +0 -28
- package/index.js +0 -44
- package/local-storage/index.d.ts +0 -4
- package/local-storage/index.js +0 -20
- package/setupTests.d.ts +0 -1
- package/setupTests.js +0 -52
- package/storybook/index.d.ts +0 -17
- package/storybook/index.js +0 -33
|
@@ -1,80 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* Converts a remote image URL to a base64 string
|
|
4
|
-
* @param url - The remote URL of the image
|
|
5
|
-
* @returns Promise<string> - The base64 encoded string of the image
|
|
6
|
-
* @throws Error if the image cannot be fetched or converted
|
|
7
|
-
*/
|
|
8
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
19
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
24
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.imageUrlToBase64 = void 0;
|
|
46
|
-
var imageUrlToBase64 = function (url) { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
-
var response, blob_1, error_1;
|
|
48
|
-
return __generator(this, function (_a) {
|
|
49
|
-
switch (_a.label) {
|
|
50
|
-
case 0:
|
|
51
|
-
_a.trys.push([0, 3, , 4]);
|
|
52
|
-
return [4 /*yield*/, fetch(url)];
|
|
53
|
-
case 1:
|
|
54
|
-
response = _a.sent();
|
|
55
|
-
if (!response.ok) {
|
|
56
|
-
throw new Error("Failed to fetch image: ".concat(response.statusText));
|
|
57
|
-
}
|
|
58
|
-
return [4 /*yield*/, response.blob()];
|
|
59
|
-
case 2:
|
|
60
|
-
blob_1 = _a.sent();
|
|
61
|
-
// Convert blob to base64
|
|
62
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
63
|
-
var reader = new FileReader();
|
|
64
|
-
reader.onloadend = function () {
|
|
65
|
-
var base64String = reader.result;
|
|
66
|
-
resolve(base64String);
|
|
67
|
-
};
|
|
68
|
-
reader.onerror = function () {
|
|
69
|
-
reject(new Error('Failed to convert image to base64'));
|
|
70
|
-
};
|
|
71
|
-
reader.readAsDataURL(blob_1);
|
|
72
|
-
})];
|
|
73
|
-
case 3:
|
|
74
|
-
error_1 = _a.sent();
|
|
75
|
-
throw new Error("Error converting image URL to base64: ".concat(error_1 instanceof Error ? error_1.message : 'Unknown error'));
|
|
76
|
-
case 4: return [2 /*return*/];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}); };
|
|
80
|
-
exports.imageUrlToBase64 = imageUrlToBase64;
|
|
1
|
+
var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},b=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of g(r))!w.call(e,o)&&o!==t&&s(e,o,{get:()=>r[o],enumerable:!(n=c(r,o))||n.enumerable});return e};var d=e=>b(s({},"__esModule",{value:!0}),e);var h={};l(h,{imageUrlToBase64:()=>m});module.exports=d(h);const m=async e=>{try{const r=await fetch(e);if(!r.ok)throw new Error(`Failed to fetch image: ${r.statusText}`);const t=await r.blob();return new Promise((n,o)=>{const a=new FileReader;a.onloadend=()=>{const i=a.result;n(i)},a.onerror=()=>{o(new Error("Failed to convert image to base64"))},a.readAsDataURL(t)})}catch(r){throw new Error(`Error converting image URL to base64: ${r instanceof Error?r.message:"Unknown error"}`)}};0&&(module.exports={imageUrlToBase64});
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* Returns `true` if createdAt and updatedAt are present and equal (created),
|
|
6
6
|
* otherwise returns `false` (updated or timestamps missing).
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function isCreatedOrUpdated(entity: {
|
|
9
9
|
createdAt?: string | Date | null;
|
|
10
10
|
updatedAt?: string | Date | null;
|
|
11
11
|
}): boolean;
|
|
12
|
+
|
|
13
|
+
export { isCreatedOrUpdated };
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCreatedOrUpdated = isCreatedOrUpdated;
|
|
4
|
-
/**
|
|
5
|
-
* Utility to determine whether a returned entity was just created
|
|
6
|
-
* by comparing createdAt and updatedAt timestamps.
|
|
7
|
-
*
|
|
8
|
-
* Returns `true` if createdAt and updatedAt are present and equal (created),
|
|
9
|
-
* otherwise returns `false` (updated or timestamps missing).
|
|
10
|
-
*/
|
|
11
|
-
function isCreatedOrUpdated(entity) {
|
|
12
|
-
if (!entity)
|
|
13
|
-
return false;
|
|
14
|
-
var toDate = function (v) {
|
|
15
|
-
if (v === undefined || v === null)
|
|
16
|
-
return undefined;
|
|
17
|
-
if (typeof v === 'string')
|
|
18
|
-
return new Date(v);
|
|
19
|
-
return v instanceof Date ? v : new Date(String(v));
|
|
20
|
-
};
|
|
21
|
-
var created = toDate(entity.createdAt);
|
|
22
|
-
var updated = toDate(entity.updatedAt);
|
|
23
|
-
if (!created || !updated)
|
|
24
|
-
return false;
|
|
25
|
-
return created.getTime() === updated.getTime();
|
|
26
|
-
}
|
|
1
|
+
var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var l=(n,t)=>{for(var r in t)d(n,r,{get:t[r],enumerable:!0})},s=(n,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of i(t))!f.call(n,e)&&e!==r&&d(n,e,{get:()=>t[e],enumerable:!(a=u(t,e))||a.enumerable});return n};var o=n=>s(d({},"__esModule",{value:!0}),n);var D={};l(D,{isCreatedOrUpdated:()=>c});module.exports=o(D);function c(n){if(!n)return!1;const t=e=>{if(e!=null)return typeof e=="string"?new Date(e):e instanceof Date?e:new Date(String(e))},r=t(n.createdAt),a=t(n.updatedAt);return!r||!a?!1:r.getTime()===a.getTime()}0&&(module.exports={isCreatedOrUpdated});
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Returns true when the current page is the last page.
|
|
3
|
+
* @param currentPage - The current page number.
|
|
4
|
+
* @param totalPages - The total number of pages.
|
|
5
|
+
* @returns True if the next button should be disabled.
|
|
6
|
+
*/
|
|
7
|
+
declare const isNextButtonDisabled: (currentPage: number, totalPages: number) => boolean;
|
|
8
|
+
|
|
9
|
+
export { isNextButtonDisabled };
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNextButtonDisabled = void 0;
|
|
4
|
-
var isNextButtonDisabled = function (currentPage, totalPages) { return currentPage >= totalPages; };
|
|
5
|
-
exports.isNextButtonDisabled = isNextButtonDisabled;
|
|
1
|
+
var b=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var i=(n,e)=>{for(var t in e)b(n,t,{get:e[t],enumerable:!0})},l=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of u(e))!a.call(n,o)&&o!==t&&b(n,o,{get:()=>e[o],enumerable:!(r=s(e,o))||r.enumerable});return n};var m=n=>l(b({},"__esModule",{value:!0}),n);var c={};i(c,{isNextButtonDisabled:()=>x});module.exports=m(c);const x=(n,e)=>n>=e;0&&(module.exports={isNextButtonDisabled});
|
package/general/is-odd.d.ts
CHANGED
package/general/is-odd.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to check if the provided number is even of odd
|
|
4
|
-
*
|
|
5
|
-
* @returns boolean
|
|
6
|
-
* @author Taimoor Khan
|
|
7
|
-
* @remarks Belle For You
|
|
8
|
-
*/
|
|
9
|
-
/** End file docs */
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.isOdd = void 0;
|
|
12
|
-
var isOdd = function (num) { return num % 2 !== 0; };
|
|
13
|
-
exports.isOdd = isOdd;
|
|
1
|
+
var d=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var b in e)d(o,b,{get:e[b],enumerable:!0})},i=(o,e,b,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of t(e))!a.call(o,n)&&n!==b&&d(o,n,{get:()=>e[n],enumerable:!(r=s(e,n))||r.enumerable});return o};var l=o=>i(d({},"__esModule",{value:!0}),o);var p={};c(p,{isOdd:()=>m});module.exports=l(p);const m=o=>o%2!==0;0&&(module.exports={isOdd});
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Returns true when the current page is the first page.
|
|
3
|
+
* @param currentPage - The current page number.
|
|
4
|
+
* @returns True if the previous button should be disabled.
|
|
5
|
+
*/
|
|
6
|
+
declare const isPreviousButtonDisabled: (currentPage: number) => boolean;
|
|
7
|
+
|
|
8
|
+
export { isPreviousButtonDisabled };
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPreviousButtonDisabled = void 0;
|
|
4
|
-
var isPreviousButtonDisabled = function (currentPage) {
|
|
5
|
-
return currentPage <= 1;
|
|
6
|
-
};
|
|
7
|
-
exports.isPreviousButtonDisabled = isPreviousButtonDisabled;
|
|
1
|
+
var t=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=(o,e)=>{for(var s in e)t(o,s,{get:e[s],enumerable:!0})},l=(o,e,s,b)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!u.call(o,n)&&n!==s&&t(o,n,{get:()=>e[n],enumerable:!(b=i(e,n))||b.enumerable});return o};var c=o=>l(t({},"__esModule",{value:!0}),o);var m={};a(m,{isPreviousButtonDisabled:()=>d});module.exports=c(m);const d=o=>o<=1;0&&(module.exports={isPreviousButtonDisabled});
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* @remarks React Design Collection
|
|
6
6
|
*/
|
|
7
7
|
/** End file docs */
|
|
8
|
-
|
|
8
|
+
interface ILinearGradient {
|
|
9
9
|
primary: string;
|
|
10
10
|
secondary: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare const linearGradients: Array<ILinearGradient>;
|
|
13
|
+
|
|
14
|
+
export { type ILinearGradient, linearGradients };
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util which has a list of primary and secondary gradient colors.
|
|
4
|
-
*
|
|
5
|
-
* @author Taimoor Khan
|
|
6
|
-
* @remarks React Design Collection
|
|
7
|
-
*/
|
|
8
|
-
/** End file docs */
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.linearGradients = void 0;
|
|
11
|
-
exports.linearGradients = [
|
|
12
|
-
{
|
|
13
|
-
primary: '#A8FF78',
|
|
14
|
-
secondary: '#78FFD6',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
primary: '#ED213A',
|
|
18
|
-
secondary: '#93291E',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
primary: '#FDC830',
|
|
22
|
-
secondary: '#F37335',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
primary: '#00B4DB',
|
|
26
|
-
secondary: '#0083B0',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
primary: '#FFEFBA',
|
|
30
|
-
secondary: '#FFFFFF',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
primary: '#005AA7',
|
|
34
|
-
secondary: '#FFFDE4',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
primary: '#DA4453',
|
|
38
|
-
secondary: '#89216B',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
primary: '#636363',
|
|
42
|
-
secondary: '#A2AB58',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
primary: '#A8C0FF',
|
|
46
|
-
secondary: '#3F2B96',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
primary: '#11998E',
|
|
50
|
-
secondary: '#38EF7D',
|
|
51
|
-
},
|
|
52
|
-
];
|
|
1
|
+
var e=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var o=(a,r)=>{for(var F in r)e(a,F,{get:r[F],enumerable:!0})},c=(a,r,F,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let y of s(r))!d.call(a,y)&&y!==F&&e(a,y,{get:()=>r[y],enumerable:!(n=i(r,y))||n.enumerable});return a};var p=a=>c(e({},"__esModule",{value:!0}),a);var A={};o(A,{linearGradients:()=>m});module.exports=p(A);const m=[{primary:"#A8FF78",secondary:"#78FFD6"},{primary:"#ED213A",secondary:"#93291E"},{primary:"#FDC830",secondary:"#F37335"},{primary:"#00B4DB",secondary:"#0083B0"},{primary:"#FFEFBA",secondary:"#FFFFFF"},{primary:"#005AA7",secondary:"#FFFDE4"},{primary:"#DA4453",secondary:"#89216B"},{primary:"#636363",secondary:"#A2AB58"},{primary:"#A8C0FF",secondary:"#3F2B96"},{primary:"#11998E",secondary:"#38EF7D"}];0&&(module.exports={linearGradients});
|
|
@@ -10,5 +10,13 @@ interface Return {
|
|
|
10
10
|
mode: SearchMode;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Splits a search string into multiple parts for multi-column contains filtering.
|
|
15
|
+
* @param params.fullText - The full search text.
|
|
16
|
+
* @param params.columnName - The column name to search against.
|
|
17
|
+
* @param params.searchMode - Search mode ('insensitive' or 'sensitive').
|
|
18
|
+
* @returns Array of filter objects for each word.
|
|
19
|
+
*/
|
|
20
|
+
declare const multiPartSearch: ({ fullText, columnName, searchMode, }: Params) => Array<Return>;
|
|
21
|
+
|
|
22
|
+
export { multiPartSearch };
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.multiPartSearch = void 0;
|
|
4
|
-
var multiPartSearch = function (_a) {
|
|
5
|
-
var fullText = _a.fullText, columnName = _a.columnName, _b = _a.searchMode, searchMode = _b === void 0 ? 'insensitive' : _b;
|
|
6
|
-
return fullText === null || fullText === void 0 ? void 0 : fullText.split(' ').map(function (text) {
|
|
7
|
-
var _a;
|
|
8
|
-
return (_a = {},
|
|
9
|
-
_a[columnName] = {
|
|
10
|
-
contains: text,
|
|
11
|
-
mode: searchMode,
|
|
12
|
-
},
|
|
13
|
-
_a);
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
exports.multiPartSearch = multiPartSearch;
|
|
1
|
+
var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},d=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!o.call(t,r)&&r!==n&&s(t,r,{get:()=>e[r],enumerable:!(i=a(e,r))||i.enumerable});return t};var g=t=>d(s({},"__esModule",{value:!0}),t);var l={};m(l,{multiPartSearch:()=>h});module.exports=g(l);const h=({fullText:t,columnName:e,searchMode:n="insensitive"})=>t?.split(" ").map(i=>({[e]:{contains:i,mode:n}}));0&&(module.exports={multiPartSearch});
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a phone number to E.164 digits (without leading +), returns null for null input.
|
|
3
|
+
* @param value - The raw phone number value.
|
|
4
|
+
* @returns Digits-only E.164 string, null for null input, or undefined if invalid.
|
|
5
|
+
*/
|
|
6
|
+
declare function normalizePhone(value: unknown): string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Formats a phone number in international format for display.
|
|
9
|
+
* @param value - The raw phone number value.
|
|
10
|
+
* @param defaultCountry - Optional default country code for parsing.
|
|
11
|
+
* @returns The formatted phone number, or undefined if invalid.
|
|
12
|
+
*/
|
|
13
|
+
declare function formatPhoneDisplay(value: unknown, defaultCountry?: string): string | undefined;
|
|
14
|
+
|
|
15
|
+
export { formatPhoneDisplay, normalizePhone };
|
|
@@ -1,40 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizePhone = normalizePhone;
|
|
4
|
-
exports.formatPhoneDisplay = formatPhoneDisplay;
|
|
5
|
-
var libphonenumber_js_1 = require("libphonenumber-js");
|
|
6
|
-
function normalizePhone(value) {
|
|
7
|
-
if (value === null)
|
|
8
|
-
return null;
|
|
9
|
-
if (typeof value !== 'string')
|
|
10
|
-
return undefined;
|
|
11
|
-
var trimmed = value.trim();
|
|
12
|
-
try {
|
|
13
|
-
var pn = (0, libphonenumber_js_1.parsePhoneNumberFromString)(trimmed);
|
|
14
|
-
if (pn && pn.isValid()) {
|
|
15
|
-
// Return E.164 digits without the leading +
|
|
16
|
-
return pn.number.replace(/\+/g, '');
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
catch (_a) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function formatPhoneDisplay(value, defaultCountry) {
|
|
25
|
-
if (value === null)
|
|
26
|
-
return undefined;
|
|
27
|
-
if (typeof value !== 'string')
|
|
28
|
-
return undefined;
|
|
29
|
-
var trimmed = value.trim();
|
|
30
|
-
try {
|
|
31
|
-
var pn = (0, libphonenumber_js_1.parsePhoneNumberFromString)(trimmed, defaultCountry);
|
|
32
|
-
if (pn && pn.isValid()) {
|
|
33
|
-
return pn.formatInternational();
|
|
34
|
-
}
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
catch (_a) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var s=(n,r)=>{for(var e in r)u(n,e,{get:r[e],enumerable:!0})},c=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of o(r))!m.call(n,i)&&i!==e&&u(n,i,{get:()=>r[i],enumerable:!(t=f(r,i))||t.enumerable});return n};var a=n=>c(u({},"__esModule",{value:!0}),n);var g={};s(g,{formatPhoneDisplay:()=>p,normalizePhone:()=>l});module.exports=a(g);var d=require("libphonenumber-js");function l(n){if(n===null)return null;if(typeof n!="string")return;const r=n.trim();try{const e=(0,d.parsePhoneNumberFromString)(r);return e&&e.isValid()?e.number.replace(/\+/g,""):void 0}catch{return}}function p(n,r){if(n===null||typeof n!="string")return;const e=n.trim();try{const t=(0,d.parsePhoneNumberFromString)(e,r);return t&&t.isValid()?t.formatInternational():void 0}catch{return}}0&&(module.exports={formatPhoneDisplay,normalizePhone});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface BlogMetadata {
|
|
2
2
|
authorImage: string;
|
|
3
3
|
authorName: string;
|
|
4
4
|
banner: string;
|
|
@@ -13,7 +13,7 @@ export interface BlogMetadata {
|
|
|
13
13
|
title: string;
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
interface RemoteBlogData {
|
|
17
17
|
claps: number;
|
|
18
18
|
content: string;
|
|
19
19
|
createdAt: string;
|
|
@@ -22,8 +22,15 @@ export interface RemoteBlogData {
|
|
|
22
22
|
slug: string;
|
|
23
23
|
updatedAt: string;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
interface Frontmatter {
|
|
26
26
|
content: string;
|
|
27
27
|
metadata: BlogMetadata;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Parses frontmatter and body content from a remote blog data object.
|
|
31
|
+
* @param data - The remote blog data containing markdown with frontmatter.
|
|
32
|
+
* @returns Object with parsed `metadata` and `content`.
|
|
33
|
+
*/
|
|
34
|
+
declare const parseFrontmatter: (data: RemoteBlogData) => Frontmatter;
|
|
35
|
+
|
|
36
|
+
export { type BlogMetadata, type Frontmatter, type RemoteBlogData, parseFrontmatter };
|
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
exports.parseFrontmatter = void 0;
|
|
4
|
-
var parseFrontmatter = function (data) {
|
|
5
|
-
var _a;
|
|
6
|
-
var frontmatterRegex = /---\s*([\s\S]*?)\s*---/;
|
|
7
|
-
var match = frontmatterRegex.exec(data.content);
|
|
8
|
-
var frontMatterBlock = match[1];
|
|
9
|
-
var content = (_a = data.content) === null || _a === void 0 ? void 0 : _a.replace(frontmatterRegex, '').trim();
|
|
10
|
-
var frontMatterLines = frontMatterBlock.trim().split('\n');
|
|
11
|
-
var metadata = {
|
|
12
|
-
authorImage: '',
|
|
13
|
-
authorName: '',
|
|
14
|
-
banner: '',
|
|
15
|
-
category: '',
|
|
16
|
-
excerpt: '',
|
|
17
|
-
timeToRead: '',
|
|
18
|
-
title: '',
|
|
19
|
-
updatedAt: data.updatedAt,
|
|
20
|
-
slug: data.slug,
|
|
21
|
-
isPublished: data.isPublished,
|
|
22
|
-
id: data.id,
|
|
23
|
-
createdAt: data.createdAt,
|
|
24
|
-
claps: data.claps,
|
|
25
|
-
};
|
|
26
|
-
frontMatterLines.forEach(function (line) {
|
|
27
|
-
var _a = line.trim().split(': '), key = _a[0], valueArr = _a.slice(1);
|
|
28
|
-
var value = valueArr.join(': ').trim();
|
|
29
|
-
value = value.replace(/^['"](.*)['"]$/, '$1'); // Remove quotes
|
|
30
|
-
// @ts-expect-error resolve error
|
|
31
|
-
metadata[key.trim()] = value;
|
|
32
|
-
});
|
|
33
|
-
return { metadata: metadata, content: content };
|
|
34
|
-
};
|
|
35
|
-
exports.parseFrontmatter = parseFrontmatter;
|
|
1
|
+
var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},b=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!p.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(a=u(e,r))||a.enumerable});return t};var A=t=>b(o({},"__esModule",{value:!0}),t);var x={};h(x,{parseFrontmatter:()=>f});module.exports=A(x);const f=t=>{const e=/---\s*([\s\S]*?)\s*---/,a=e.exec(t.content)[1],r=t.content?.replace(e,"").trim(),c=a.trim().split(`
|
|
2
|
+
`),i={authorImage:"",authorName:"",banner:"",category:"",excerpt:"",timeToRead:"",title:"",updatedAt:t.updatedAt,slug:t.slug,isPublished:t.isPublished,id:t.id,createdAt:t.createdAt,claps:t.claps};return c.forEach(g=>{const[l,...m]=g.trim().split(": ");let s=m.join(": ").trim();s=s.replace(/^['"](.*)['"]$/,"$1"),i[l.trim()]=s}),{metadata:i,content:r}};0&&(module.exports={parseFrontmatter});
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Removes the `data:image/jpeg;base64,` prefix from a base64 string.
|
|
3
|
+
* @param base64 - The base64 string with potential prefix.
|
|
4
|
+
* @returns The base64 string without the prefix.
|
|
5
|
+
*/
|
|
6
|
+
declare const removeDataImagePrefix: (base64: string) => string;
|
|
7
|
+
|
|
8
|
+
export { removeDataImagePrefix };
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeDataImagePrefix = void 0;
|
|
4
|
-
var removeDataImagePrefix = function (base64) {
|
|
5
|
-
return base64.replace(/data:image\/jpeg;base64,/i, '');
|
|
6
|
-
};
|
|
7
|
-
exports.removeDataImagePrefix = removeDataImagePrefix;
|
|
1
|
+
var g=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var o=(e,a)=>{for(var t in a)g(e,t,{get:a[t],enumerable:!0})},p=(e,a,t,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of m(a))!n.call(e,r)&&r!==t&&g(e,r,{get:()=>a[r],enumerable:!(i=s(a,r))||i.enumerable});return e};var c=e=>p(g({},"__esModule",{value:!0}),e);var b={};o(b,{removeDataImagePrefix:()=>x});module.exports=c(b);const x=e=>e.replace(/data:image\/jpeg;base64,/i,"");0&&(module.exports={removeDataImagePrefix});
|
package/general/repeat-times.js
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to repeat number of times a provided string
|
|
4
|
-
* dependent on the provided array length either odd or even
|
|
5
|
-
* to maintain grid flow respectively.
|
|
6
|
-
*
|
|
7
|
-
* @param str str - string to repeat
|
|
8
|
-
* @param arr arr - number of times depend on if provided array is even or odd length
|
|
9
|
-
* @returns stringToRepeat - concated string number of times calculated
|
|
10
|
-
* @author Taimoor Khan
|
|
11
|
-
* @remarks Taimoor Khan Resume v3
|
|
12
|
-
*/
|
|
13
|
-
/** End file docs */
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.repeatTimes = void 0;
|
|
16
|
-
var check_even_odd_length_1 = require("./check-even-odd-length");
|
|
17
|
-
var repeatTimes = function (str, arr) {
|
|
18
|
-
var stringToRepeat = str.repeat(arr.length / (0, check_even_odd_length_1.checkEvenOddLength)(arr));
|
|
19
|
-
return stringToRepeat;
|
|
20
|
-
};
|
|
21
|
-
exports.repeatTimes = repeatTimes;
|
|
1
|
+
var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},h=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!a.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(s=i(e,r))||s.enumerable});return t};var m=t=>h(o({},"__esModule",{value:!0}),t);var d={};c(d,{repeatTimes:()=>T});module.exports=m(d);var g=require("./check-even-odd-length");const T=(t,e)=>t.repeat(e.length/(0,g.checkEvenOddLength)(e));0&&(module.exports={repeatTimes});
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to resolve anchor link
|
|
4
|
-
* either for phone, email or url
|
|
5
|
-
*
|
|
6
|
-
* @param string string - string to resolve
|
|
7
|
-
* @returns anchorMap - one of the matching property
|
|
8
|
-
* @author Taimoor Khan
|
|
9
|
-
* @remarks React UI Collection
|
|
10
|
-
*/
|
|
11
|
-
/** End file docs */
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.resolveAnchorLink = void 0;
|
|
14
|
-
var resolveAnchorLink = function (string) {
|
|
15
|
-
var anchorMap = {
|
|
16
|
-
phone: "tel:".concat(string),
|
|
17
|
-
email: "mailto:".concat(string),
|
|
18
|
-
url: string,
|
|
19
|
-
};
|
|
20
|
-
if (string.match(/^[+]/))
|
|
21
|
-
return anchorMap.phone;
|
|
22
|
-
if (string.match(/@/))
|
|
23
|
-
return anchorMap.email;
|
|
24
|
-
return anchorMap.url;
|
|
25
|
-
};
|
|
26
|
-
exports.resolveAnchorLink = resolveAnchorLink;
|
|
1
|
+
var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},m=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of h(e))!i.call(r,n)&&n!==o&&t(r,n,{get:()=>e[n],enumerable:!(a=c(e,n))||a.enumerable});return r};var u=r=>m(t({},"__esModule",{value:!0}),r);var s={};l(s,{resolveAnchorLink:()=>p});module.exports=u(s);const p=r=>{const e={phone:`tel:${r}`,email:`mailto:${r}`,url:r};return r.match(/^[+]/)?e.phone:r.match(/@/)?e.email:e.url};0&&(module.exports={resolveAnchorLink});
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to resolve current date in following format
|
|
4
|
-
* eg: Saturday, 11/01/2020
|
|
5
|
-
*
|
|
6
|
-
* @returns formated date - Saturday, 11/01/2020
|
|
7
|
-
* @author Taimoor Khan
|
|
8
|
-
* @remarks Taimoor Khan Resume v3
|
|
9
|
-
*/
|
|
10
|
-
/** End file docs */
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.resolveCurrentDate = void 0;
|
|
13
|
-
var resolveCurrentDate = function () {
|
|
14
|
-
var currentDate = new Date();
|
|
15
|
-
return currentDate.toLocaleString('en-GB', {
|
|
16
|
-
weekday: 'long',
|
|
17
|
-
year: 'numeric',
|
|
18
|
-
month: '2-digit',
|
|
19
|
-
day: '2-digit',
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.resolveCurrentDate = resolveCurrentDate;
|
|
1
|
+
var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},d=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!g.call(t,r)&&r!==n&&a(t,r,{get:()=>e[r],enumerable:!(o=i(e,r))||o.enumerable});return t};var s=t=>d(a({},"__esModule",{value:!0}),t);var l={};u(l,{resolveCurrentDate:()=>D});module.exports=s(l);const D=()=>new Date().toLocaleString("en-GB",{weekday:"long",year:"numeric",month:"2-digit",day:"2-digit"});0&&(module.exports={resolveCurrentDate});
|
package/general/resolve-grid.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to resolve Grid columns
|
|
4
|
-
* depending on the length of provided array
|
|
5
|
-
*
|
|
6
|
-
* @param array Array<any> - array of content
|
|
7
|
-
* @param string string - string that needs to be repeated number of array length times
|
|
8
|
-
* @returns string - formatted grid column string as per array length
|
|
9
|
-
* @author Taimoor Khan
|
|
10
|
-
* @remarks React Storybook UI
|
|
11
|
-
*/
|
|
12
|
-
/** End file docs */
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.resolveGrid = void 0;
|
|
15
|
-
var resolveGrid = function (array, gridSize) {
|
|
16
|
-
return "repeat(".concat(array.length, ", ").concat(gridSize, ")");
|
|
17
|
-
};
|
|
18
|
-
exports.resolveGrid = resolveGrid;
|
|
1
|
+
var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var n in r)s(e,n,{get:r[n],enumerable:!0})},p=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of i(r))!o.call(e,t)&&t!==n&&s(e,t,{get:()=>r[t],enumerable:!(a=g(r,t))||a.enumerable});return e};var y=e=>p(s({},"__esModule",{value:!0}),e);var c={};l(c,{resolveGrid:()=>$});module.exports=y(c);const $=(e,r)=>`repeat(${e.length}, ${r})`;0&&(module.exports={resolveGrid});
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* A util function to resolve initials of provided name
|
|
4
|
-
* eg: TK
|
|
5
|
-
*
|
|
6
|
-
* @returns Initials - Taimoor Khan as TK
|
|
7
|
-
* @author Taimoor Khan
|
|
8
|
-
* @remarks React Storybook UI
|
|
9
|
-
*/
|
|
10
|
-
/** End file docs */
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.resolveInitials = void 0;
|
|
13
|
-
var resolveInitials = function (str) {
|
|
14
|
-
var arr = str.split(' ');
|
|
15
|
-
return arr[0][0].toUpperCase() + arr[1][0].toUpperCase();
|
|
16
|
-
};
|
|
17
|
-
exports.resolveInitials = resolveInitials;
|
|
1
|
+
var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},c=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of i(r))!a.call(t,s)&&s!==e&&n(t,s,{get:()=>r[s],enumerable:!(o=p(r,s))||o.enumerable});return t};var g=t=>c(n({},"__esModule",{value:!0}),t);var U={};l(U,{resolveInitials:()=>C});module.exports=g(U);const C=t=>{const r=t.split(" ");return r[0][0].toUpperCase()+r[1][0].toUpperCase()};0&&(module.exports={resolveInitials});
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import * as lodash from 'lodash';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a UTC date to a specified timezone (default Asia/Karachi).
|
|
5
|
+
* @param date - The UTC date to convert.
|
|
6
|
+
* @param timezone - The target timezone string.
|
|
7
|
+
* @returns The date in the specified timezone.
|
|
8
|
+
*/
|
|
9
|
+
declare const setTimezone: lodash.CurriedFunction2<Date, string | undefined, Date>;
|
|
10
|
+
|
|
11
|
+
export { setTimezone };
|