chronos-date 2.0.4 → 2.1.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.
Files changed (85) hide show
  1. package/dist/constants.d.mts +1 -1
  2. package/dist/convert-C8LsoKmI-Blf3eLS6.mjs +285 -0
  3. package/dist/convert-C8LsoKmI-uBhT5hZQ.cjs +387 -0
  4. package/dist/dist-BPHYJA0t.mjs +70 -0
  5. package/dist/dist-CdMlZMZa.cjs +75 -0
  6. package/dist/{greet-DNGvP7nm.mjs → greet-BC86-X9W.mjs} +2 -2
  7. package/dist/{greet-CMkwXJ7o.cjs → greet-Brz0CVv1.cjs} +8 -8
  8. package/dist/guards-DTI799nG.mjs +46 -0
  9. package/dist/guards-dH9JJIso.cjs +51 -0
  10. package/dist/guards.cjs +14 -16
  11. package/dist/guards.d.cts +1 -1
  12. package/dist/guards.d.mts +1 -1
  13. package/dist/guards.mjs +1 -3
  14. package/dist/{helpers-Bq7Hczoa.cjs → helpers-BMDeRLjO.cjs} +6 -8
  15. package/dist/{helpers-C2spzGZ-.mjs → helpers-t49KkxOE.mjs} +2 -4
  16. package/dist/index.cjs +13 -14
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +4 -5
  20. package/dist/plugins/banglaPlugin.cjs +16 -33
  21. package/dist/plugins/banglaPlugin.d.cts +1 -1
  22. package/dist/plugins/banglaPlugin.d.mts +1 -1
  23. package/dist/plugins/banglaPlugin.mjs +2 -19
  24. package/dist/plugins/businessPlugin.cjs +4 -5
  25. package/dist/plugins/businessPlugin.d.cts +1 -1
  26. package/dist/plugins/businessPlugin.d.mts +1 -1
  27. package/dist/plugins/businessPlugin.mjs +1 -2
  28. package/dist/plugins/dateRangePlugin.cjs +4 -5
  29. package/dist/plugins/dateRangePlugin.d.cts +1 -1
  30. package/dist/plugins/dateRangePlugin.d.mts +1 -1
  31. package/dist/plugins/dateRangePlugin.mjs +1 -2
  32. package/dist/plugins/dayPartPlugin.cjs +2 -2
  33. package/dist/plugins/dayPartPlugin.d.cts +1 -1
  34. package/dist/plugins/dayPartPlugin.d.mts +1 -1
  35. package/dist/plugins/dayPartPlugin.mjs +1 -1
  36. package/dist/plugins/durationPlugin.d.cts +1 -1
  37. package/dist/plugins/durationPlugin.d.mts +1 -1
  38. package/dist/plugins/fromNowPlugin.cjs +2 -2
  39. package/dist/plugins/fromNowPlugin.d.cts +1 -1
  40. package/dist/plugins/fromNowPlugin.d.mts +1 -1
  41. package/dist/plugins/fromNowPlugin.mjs +1 -1
  42. package/dist/plugins/greetingPlugin.cjs +1 -1
  43. package/dist/plugins/greetingPlugin.d.cts +1 -1
  44. package/dist/plugins/greetingPlugin.d.mts +1 -1
  45. package/dist/plugins/greetingPlugin.mjs +1 -1
  46. package/dist/plugins/palindromePlugin.cjs +2 -9
  47. package/dist/plugins/palindromePlugin.d.cts +1 -1
  48. package/dist/plugins/palindromePlugin.d.mts +1 -1
  49. package/dist/plugins/palindromePlugin.mjs +1 -8
  50. package/dist/plugins/relativeTimePlugin.d.cts +1 -1
  51. package/dist/plugins/relativeTimePlugin.d.mts +1 -1
  52. package/dist/plugins/roundPlugin.cjs +8 -8
  53. package/dist/plugins/roundPlugin.d.cts +1 -1
  54. package/dist/plugins/roundPlugin.d.mts +1 -1
  55. package/dist/plugins/roundPlugin.mjs +1 -1
  56. package/dist/plugins/seasonPlugin.d.cts +1 -1
  57. package/dist/plugins/seasonPlugin.d.mts +1 -1
  58. package/dist/plugins/timeZonePlugin.cjs +3 -3
  59. package/dist/plugins/timeZonePlugin.d.cts +1 -1
  60. package/dist/plugins/timeZonePlugin.d.mts +1 -1
  61. package/dist/plugins/timeZonePlugin.mjs +2 -2
  62. package/dist/plugins/zodiacPlugin.cjs +1 -1
  63. package/dist/plugins/zodiacPlugin.d.cts +1 -1
  64. package/dist/plugins/zodiacPlugin.d.mts +1 -1
  65. package/dist/plugins/zodiacPlugin.mjs +1 -1
  66. package/dist/{types-Be4ZMpOV.d.mts → types-CiFnGEL8.d.mts} +967 -902
  67. package/dist/{types-dNpvroNQ.d.cts → types-zhhEJ8N7.d.cts} +966 -901
  68. package/dist/types.d.cts +1 -1
  69. package/dist/types.d.mts +1 -1
  70. package/dist/{utilities-C6NiChRE.mjs → utils-DBy7S7hH.mjs} +3 -5
  71. package/dist/{utilities-CCnKWAsS.cjs → utils-S_aw0TeC.cjs} +8 -10
  72. package/dist/utils.cjs +33 -34
  73. package/dist/utils.d.cts +4 -4
  74. package/dist/utils.d.mts +4 -4
  75. package/dist/utils.mjs +4 -5
  76. package/package.json +3 -3
  77. package/dist/convert-BDQBTK5P.cjs +0 -49
  78. package/dist/convert-D5Cd0cCg.mjs +0 -38
  79. package/dist/non-primitives-BqjRwK2B.cjs +0 -68
  80. package/dist/non-primitives-CbAOB6lb.mjs +0 -38
  81. package/dist/primitives-BXhrgs9R.mjs +0 -35
  82. package/dist/primitives-DfO90c3G.cjs +0 -65
  83. package/dist/utilities-BnHD2hHf.mjs +0 -59
  84. package/dist/utilities-C_KmjIRK.cjs +0 -88
  85. /package/dist/{seasons-B_kjFWIX.d.mts → seasons-DYk2jvtn.d.mts} +0 -0
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { c as isNumericString, f as BN_DIGITS, h as isNumber, m as isNonEmptyString } from "./convert-C8LsoKmI-Blf3eLS6.mjs";
18
+
19
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/index.mjs
20
+ /**
21
+ * Copyright 2026 - present Nazmul Hassan
22
+ *
23
+ * Licensed under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ /**
36
+ * * Converts Latin (Arabic system) digits to Bangla digits (Arabic system).
37
+ *
38
+ * @remarks
39
+ * - Accepts numbers or numeric strings including non-digit characters.
40
+ * - When `preserveNonDigit` is `true`, non-digit characters are preserved in the output.
41
+ * - When `preserveNonDigit` is `false`, non-numeric strings are stripped.
42
+ * - Returns empty string for invalid input.
43
+ *
44
+ * @param digit - A number or string containing Latin (Arabic system) digits.
45
+ * @param preserveNonDigit - Whether to preserve non-digit characters in the output. Default is `true`.
46
+ *
47
+ * @example
48
+ * digitToBangla(123); // "১২৩"
49
+ * digitToBangla('456'); // "৪৫৬"
50
+ *
51
+ * @example
52
+ * digitToBangla('12ab', false); // "১২"
53
+ * digitToBangla('12ab'); // "১২ab"
54
+ */
55
+ function digitToBangla(digit, preserveNonDigit = true) {
56
+ const banglaDigits = Object.keys(BN_DIGITS);
57
+ const _matchAndConvert = (value) => {
58
+ return value.replace(/\d/g, (dig) => banglaDigits[Number(dig)]);
59
+ };
60
+ if (isNumber(digit)) return _matchAndConvert(String(digit));
61
+ if (isNonEmptyString(digit)) {
62
+ const bnDigStr = _matchAndConvert(digit);
63
+ if (preserveNonDigit || isNumericString(digit)) return bnDigStr;
64
+ return bnDigStr.split("").filter((dig) => banglaDigits.includes(dig)).join("");
65
+ }
66
+ return "";
67
+ }
68
+
69
+ //#endregion
70
+ export { digitToBangla as t };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const require_convert_C8LsoKmI = require('./convert-C8LsoKmI-uBhT5hZQ.cjs');
18
+
19
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/index.mjs
20
+ /**
21
+ * Copyright 2026 - present Nazmul Hassan
22
+ *
23
+ * Licensed under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ /**
36
+ * * Converts Latin (Arabic system) digits to Bangla digits (Arabic system).
37
+ *
38
+ * @remarks
39
+ * - Accepts numbers or numeric strings including non-digit characters.
40
+ * - When `preserveNonDigit` is `true`, non-digit characters are preserved in the output.
41
+ * - When `preserveNonDigit` is `false`, non-numeric strings are stripped.
42
+ * - Returns empty string for invalid input.
43
+ *
44
+ * @param digit - A number or string containing Latin (Arabic system) digits.
45
+ * @param preserveNonDigit - Whether to preserve non-digit characters in the output. Default is `true`.
46
+ *
47
+ * @example
48
+ * digitToBangla(123); // "১২৩"
49
+ * digitToBangla('456'); // "৪৫৬"
50
+ *
51
+ * @example
52
+ * digitToBangla('12ab', false); // "১২"
53
+ * digitToBangla('12ab'); // "১২ab"
54
+ */
55
+ function digitToBangla(digit, preserveNonDigit = true) {
56
+ const banglaDigits = Object.keys(require_convert_C8LsoKmI.BN_DIGITS);
57
+ const _matchAndConvert = (value) => {
58
+ return value.replace(/\d/g, (dig) => banglaDigits[Number(dig)]);
59
+ };
60
+ if (require_convert_C8LsoKmI.isNumber(digit)) return _matchAndConvert(String(digit));
61
+ if (require_convert_C8LsoKmI.isNonEmptyString(digit)) {
62
+ const bnDigStr = _matchAndConvert(digit);
63
+ if (preserveNonDigit || require_convert_C8LsoKmI.isNumericString(digit)) return bnDigStr;
64
+ return bnDigStr.split("").filter((dig) => banglaDigits.includes(dig)).join("");
65
+ }
66
+ return "";
67
+ }
68
+
69
+ //#endregion
70
+ Object.defineProperty(exports, 'digitToBangla', {
71
+ enumerable: true,
72
+ get: function () {
73
+ return digitToBangla;
74
+ }
75
+ });
@@ -15,9 +15,9 @@
15
15
  */
16
16
 
17
17
  import { isValidTime } from "./guards.mjs";
18
- import { n as extractHourMinute, p as getTotalMinutes } from "./utilities-C6NiChRE.mjs";
18
+ import { n as extractHourMinute, p as getTotalMinutes } from "./utils-DBy7S7hH.mjs";
19
19
 
20
- //#region src/utils/greet.ts
20
+ //#region src/utilities/greet.ts
21
21
  /**
22
22
  * * Returns a greeting message based on the provided time or current time.
23
23
  *
@@ -15,9 +15,9 @@
15
15
  */
16
16
 
17
17
  const require_guards = require('./guards.cjs');
18
- const require_utilities = require('./utilities-CCnKWAsS.cjs');
18
+ const require_utils = require('./utils-S_aw0TeC.cjs');
19
19
 
20
- //#region src/utils/greet.ts
20
+ //#region src/utilities/greet.ts
21
21
  /**
22
22
  * * Returns a greeting message based on the provided time or current time.
23
23
  *
@@ -28,18 +28,18 @@ function getGreeting(configs) {
28
28
  const { morningEnds = "11:59", noonEnds = "12:59", afternoonEnds = "17:59", eveningEnds = "23:59", midnightEnds = "02:59", currentTime, appendToMsg = "", prependToMsg = "", morningMessage = "Good Morning!", noonMessage = "Good Noon!", afternoonMessage = "Good Afternoon!", eveningMessage = "Good Evening!", midnightMessage = "Hello, Night Owl!", defaultMessage = "Greetings!" } = configs || {};
29
29
  let hour;
30
30
  let minute;
31
- if (currentTime && require_guards.isValidTime(currentTime)) [hour, minute] = require_utilities.extractHourMinute(currentTime);
31
+ if (currentTime && require_guards.isValidTime(currentTime)) [hour, minute] = require_utils.extractHourMinute(currentTime);
32
32
  else {
33
33
  const now = /* @__PURE__ */ new Date();
34
34
  hour = now.getHours();
35
35
  minute = now.getMinutes();
36
36
  }
37
37
  const currentTotalMinutes = hour * 60 + minute;
38
- const morningEndMinutes = require_utilities.getTotalMinutes(morningEnds);
39
- const noonEndMinutes = require_utilities.getTotalMinutes(noonEnds);
40
- const afternoonEndMinutes = require_utilities.getTotalMinutes(afternoonEnds);
41
- const eveningEndMinutes = require_utilities.getTotalMinutes(eveningEnds);
42
- if (currentTotalMinutes <= require_utilities.getTotalMinutes(midnightEnds)) return prependToMsg.concat(midnightMessage.concat(appendToMsg));
38
+ const morningEndMinutes = require_utils.getTotalMinutes(morningEnds);
39
+ const noonEndMinutes = require_utils.getTotalMinutes(noonEnds);
40
+ const afternoonEndMinutes = require_utils.getTotalMinutes(afternoonEnds);
41
+ const eveningEndMinutes = require_utils.getTotalMinutes(eveningEnds);
42
+ if (currentTotalMinutes <= require_utils.getTotalMinutes(midnightEnds)) return prependToMsg.concat(midnightMessage.concat(appendToMsg));
43
43
  else if (currentTotalMinutes <= morningEndMinutes) return prependToMsg.concat(morningMessage.concat(appendToMsg));
44
44
  else if (currentTotalMinutes <= noonEndMinutes) return prependToMsg.concat(noonMessage.concat(appendToMsg));
45
45
  else if (currentTotalMinutes <= afternoonEndMinutes) return prependToMsg.concat(afternoonMessage.concat(appendToMsg));
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { n as reverseString } from "./convert-C8LsoKmI-Blf3eLS6.mjs";
18
+
19
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/guards.mjs
20
+ /**
21
+ * Copyright 2026 - present Nazmul Hassan
22
+ *
23
+ * Licensed under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ /**
36
+ * * Checks if a string is a palindrome.
37
+ * @param input - The string to check.
38
+ * @returns True if the string is a palindrome, otherwise false.
39
+ */
40
+ const isPalindrome = (input) => {
41
+ const normalized = input.toLowerCase().replace(/[^a-z0-9]/g, "");
42
+ return normalized === reverseString(normalized);
43
+ };
44
+
45
+ //#endregion
46
+ export { isPalindrome as t };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const require_convert_C8LsoKmI = require('./convert-C8LsoKmI-uBhT5hZQ.cjs');
18
+
19
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/guards.mjs
20
+ /**
21
+ * Copyright 2026 - present Nazmul Hassan
22
+ *
23
+ * Licensed under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ /**
36
+ * * Checks if a string is a palindrome.
37
+ * @param input - The string to check.
38
+ * @returns True if the string is a palindrome, otherwise false.
39
+ */
40
+ const isPalindrome = (input) => {
41
+ const normalized = input.toLowerCase().replace(/[^a-z0-9]/g, "");
42
+ return normalized === require_convert_C8LsoKmI.reverseString(normalized);
43
+ };
44
+
45
+ //#endregion
46
+ Object.defineProperty(exports, 'isPalindrome', {
47
+ enumerable: true,
48
+ get: function () {
49
+ return isPalindrome;
50
+ }
51
+ });
package/dist/guards.cjs CHANGED
@@ -16,9 +16,7 @@
16
16
 
17
17
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
18
18
  const require_timezone = require('./timezone-BNnHFgki.cjs');
19
- const require_primitives = require('./primitives-DfO90c3G.cjs');
20
- const require_non_primitives = require('./non-primitives-BqjRwK2B.cjs');
21
- const require_utilities = require('./utilities-C_KmjIRK.cjs');
19
+ const require_convert_C8LsoKmI = require('./convert-C8LsoKmI-uBhT5hZQ.cjs');
22
20
 
23
21
  //#region src/guards.ts
24
22
  /**
@@ -35,7 +33,7 @@ function isDate(value) {
35
33
  * @returns `true` if the value is a valid date string, otherwise `false`.
36
34
  */
37
35
  function isDateString(value) {
38
- return require_primitives.isNonEmptyString(value) && !isNaN(Date.parse(value));
36
+ return require_convert_C8LsoKmI.isNonEmptyString(value) && !isNaN(Date.parse(value));
39
37
  }
40
38
  /**
41
39
  * * Checks if the provided value is a valid time string in "HH:MM" format.
@@ -44,9 +42,9 @@ function isDateString(value) {
44
42
  * @returns `true` if the value is a valid time string, `false` otherwise.
45
43
  */
46
44
  function isValidTime(value) {
47
- if (!require_primitives.isNonEmptyString(value)) return false;
45
+ if (!require_convert_C8LsoKmI.isNonEmptyString(value)) return false;
48
46
  const [hourStr, minuteStr] = value.split(":");
49
- if (!require_utilities.isNumericString(hourStr) || !require_utilities.isNumericString(minuteStr)) return false;
47
+ if (!require_convert_C8LsoKmI.isNumericString(hourStr) || !require_convert_C8LsoKmI.isNumericString(minuteStr)) return false;
50
48
  const hour = Number(hourStr);
51
49
  const minute = Number(minuteStr);
52
50
  return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59;
@@ -58,7 +56,7 @@ function isValidTime(value) {
58
56
  * @returns `true` if the value is a valid utc offset, `false` otherwise.
59
57
  */
60
58
  function isValidUTCOffset(value) {
61
- return require_primitives.isNonEmptyString(value) ? /^UTC[+-]?\d{1,2}:\d{2}$/.test(value) : false;
59
+ return require_convert_C8LsoKmI.isNonEmptyString(value) ? /^UTC[+-]?\d{1,2}:\d{2}$/.test(value) : false;
62
60
  }
63
61
  /**
64
62
  * * Validates whether the provided value is a recognized IANA time zone identifier (excluding `"Factory"`), based on the {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones IANA TZ Database}.
@@ -71,7 +69,7 @@ function isValidUTCOffset(value) {
71
69
  * @returns `true` if the value is a valid IANA time zone identifier, otherwise `false`.
72
70
  */
73
71
  function isValidTimeZoneId(value) {
74
- return require_primitives.isNonEmptyString(value) ? new Set([...require_timezone.IANA_TZ_IDS]).has(value) : false;
72
+ return require_convert_C8LsoKmI.isNonEmptyString(value) ? new Set([...require_timezone.IANA_TZ_IDS]).has(value) : false;
75
73
  }
76
74
  /**
77
75
  * * Validates whether the provided value is a supported time zone identifier using the native JavaScript API (`Intl.supportedValuesOf('timeZone')`).
@@ -85,7 +83,7 @@ function isValidTimeZoneId(value) {
85
83
  * @returns `true` if the value is a valid native JS-supported time zone identifier, otherwise `false`.
86
84
  */
87
85
  function isNativeTimeZoneId(value) {
88
- return require_primitives.isNonEmptyString(value) ? new Set(require_timezone.NATIVE_TZ_IDS).has(value) : false;
86
+ return require_convert_C8LsoKmI.isNonEmptyString(value) ? new Set(require_timezone.NATIVE_TZ_IDS).has(value) : false;
89
87
  }
90
88
  /**
91
89
  * * Checks if the year is a leap year.
@@ -96,7 +94,7 @@ function isNativeTimeZoneId(value) {
96
94
  * @returns `true` if the year is a leap year, `false` otherwise.
97
95
  */
98
96
  function isLeapYear(year) {
99
- const $year = require_utilities.normalizeNumber(year);
97
+ const $year = require_convert_C8LsoKmI.normalizeNumber(year);
100
98
  return $year ? $year % 4 === 0 && $year % 100 !== 0 || $year % 400 === 0 : false;
101
99
  }
102
100
  /**
@@ -106,11 +104,11 @@ function isLeapYear(year) {
106
104
  */
107
105
  function isDateLike(value) {
108
106
  if (value instanceof Date) return true;
109
- if (require_non_primitives.isObject(value)) {
110
- if (require_non_primitives.isFunction(value?.format) && require_non_primitives.isFunction(value?.toJSON) && require_non_primitives.isFunction(value?.toISOString)) return true;
111
- if (require_non_primitives.isFunction(value?.toISO) && require_non_primitives.isFunction(value?.toFormat) && require_primitives.isBoolean(value?.isValid)) return true;
112
- if (require_non_primitives.isFunction(value?.plus) && require_non_primitives.isFunction(value?.minus) && require_non_primitives.isFunction(value?.equals) && require_non_primitives.isFunction(value?.getClass)) return true;
113
- if (require_non_primitives.isFunction(value?.toJSON) && require_non_primitives.isFunction(value?.toString) && [
107
+ if (require_convert_C8LsoKmI.isObject(value)) {
108
+ if (require_convert_C8LsoKmI.isFunction(value?.format) && require_convert_C8LsoKmI.isFunction(value?.toJSON) && require_convert_C8LsoKmI.isFunction(value?.toISOString)) return true;
109
+ if (require_convert_C8LsoKmI.isFunction(value?.toISO) && require_convert_C8LsoKmI.isFunction(value?.toFormat) && require_convert_C8LsoKmI.isBoolean(value?.isValid)) return true;
110
+ if (require_convert_C8LsoKmI.isFunction(value?.plus) && require_convert_C8LsoKmI.isFunction(value?.minus) && require_convert_C8LsoKmI.isFunction(value?.equals) && require_convert_C8LsoKmI.isFunction(value?.getClass)) return true;
111
+ if (require_convert_C8LsoKmI.isFunction(value?.toJSON) && require_convert_C8LsoKmI.isFunction(value?.toString) && [
114
112
  "Instant",
115
113
  "Duration",
116
114
  "PlainDate",
@@ -125,7 +123,7 @@ function isDateLike(value) {
125
123
  }
126
124
  /** Checks if a value represents time value (number) with different forms of {@link TimeWithUnit units} */
127
125
  function isTimeWithUnit(value) {
128
- return require_primitives.isNonEmptyString(value) && /^-?\d*\.?\d+ *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mo|years?|yrs?|y)?$/i.test(value);
126
+ return require_convert_C8LsoKmI.isNonEmptyString(value) && /^-?\d*\.?\d+ *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mo|years?|yrs?|y)?$/i.test(value);
129
127
  }
130
128
 
131
129
  //#endregion
package/dist/guards.d.cts CHANGED
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { Cn as Numeric, Mt as TimeZoneIdNative, Ot as TimeWithUnit, Rt as UTCOffset, Z as $TimeZoneIdentifier, it as ClockTime, st as DateLike } from "./types-dNpvroNQ.cjs";
17
+ import { En as Numeric, Nt as TimeZoneIdNative, Q as $TimeZoneIdentifier, at as ClockTime, ct as DateLike, kt as TimeWithUnit, zt as UTCOffset } from "./types-zhhEJ8N7.cjs";
18
18
 
19
19
  //#region src/guards.d.ts
20
20
  /**
package/dist/guards.d.mts CHANGED
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { Cn as Numeric, Mt as TimeZoneIdNative, Ot as TimeWithUnit, Rt as UTCOffset, Z as $TimeZoneIdentifier, it as ClockTime, st as DateLike } from "./types-Be4ZMpOV.mjs";
17
+ import { En as Numeric, Nt as TimeZoneIdNative, Q as $TimeZoneIdentifier, at as ClockTime, ct as DateLike, kt as TimeWithUnit, zt as UTCOffset } from "./types-CiFnGEL8.mjs";
18
18
 
19
19
  //#region src/guards.d.ts
20
20
  /**
package/dist/guards.mjs CHANGED
@@ -15,9 +15,7 @@
15
15
  */
16
16
 
17
17
  import { n as NATIVE_TZ_IDS, t as IANA_TZ_IDS } from "./timezone-Db2CeL32.mjs";
18
- import { n as isNonEmptyString, t as isBoolean } from "./primitives-BXhrgs9R.mjs";
19
- import { r as isObject, t as isFunction } from "./non-primitives-CbAOB6lb.mjs";
20
- import { a as isNumericString, n as normalizeNumber } from "./utilities-BnHD2hHf.mjs";
18
+ import { c as isNumericString, i as normalizeNumber, l as isObject, m as isNonEmptyString, o as isFunction, p as isBoolean } from "./convert-C8LsoKmI-Blf3eLS6.mjs";
21
19
 
22
20
  //#region src/guards.ts
23
21
  /**
@@ -15,12 +15,10 @@
15
15
  */
16
16
 
17
17
  const require_basic = require('./basic-DsQqC5nZ.cjs');
18
- const require_primitives = require('./primitives-DfO90c3G.cjs');
19
- const require_non_primitives = require('./non-primitives-BqjRwK2B.cjs');
20
- const require_utilities = require('./utilities-C_KmjIRK.cjs');
18
+ const require_convert_C8LsoKmI = require('./convert-C8LsoKmI-uBhT5hZQ.cjs');
21
19
  const require_guards = require('./guards.cjs');
22
20
 
23
- //#region src/utils/helpers.ts
21
+ //#region src/utilities/helpers.ts
24
22
  /** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
25
23
  function _formatDateCore(format, dateComponents) {
26
24
  const tokenRegex = new RegExp(`^(${require_basic.SORTED_TIME_FORMATS.join("|")})`);
@@ -63,7 +61,7 @@ function _formatDate(format, year, month, day, date, hours, minutes, seconds, mi
63
61
  ddd: require_basic.DAYS[day],
64
62
  D: String(date),
65
63
  DD: _padZero(date),
66
- Do: require_utilities.getOrdinal(date),
64
+ Do: require_convert_C8LsoKmI.getOrdinal(date),
67
65
  H: String(hours),
68
66
  HH: _padZero(hours),
69
67
  h: String(hours % 12 || 12),
@@ -179,7 +177,7 @@ function _padShunno(str, length = 2) {
179
177
  * @returns A `Date` object representing the input date.
180
178
  */
181
179
  function _dateArgsToDate(value) {
182
- return require_guards.isDate(value) ? value : new Date(require_primitives.isString(value) ? value.replace(/['"]/g, "") : value ?? Date.now());
180
+ return require_guards.isDate(value) ? value : new Date(require_convert_C8LsoKmI.isString(value) ? value.replace(/['"]/g, "") : value ?? Date.now());
183
181
  }
184
182
  /**
185
183
  * Type guard to check if a value has the necessary properties to be reconstructed into a `Chronos` instance.
@@ -188,13 +186,13 @@ function _dateArgsToDate(value) {
188
186
  * @returns `true` if the value has the required properties for reconstruction, otherwise `false`.
189
187
  */
190
188
  function _hasChronosProperties(value) {
191
- return require_non_primitives.isObjectWithKeys(value, [
189
+ return require_convert_C8LsoKmI.isObjectWithKeys(value, [
192
190
  "origin",
193
191
  "native",
194
192
  "utcOffset",
195
193
  "timeZoneName",
196
194
  "timeZoneId"
197
- ]) && require_primitives.isNonEmptyString(value.origin) && (require_guards.isDate(value.native) || require_guards.isDateString(value.native)) && require_guards.isValidUTCOffset(value.utcOffset) && require_primitives.isNonEmptyString(value.timeZoneName) && (require_primitives.isNonEmptyString(value.timeZoneId) || require_non_primitives.isValidArray(value.timeZoneId));
195
+ ]) && require_convert_C8LsoKmI.isNonEmptyString(value.origin) && (require_guards.isDate(value.native) || require_guards.isDateString(value.native)) && require_guards.isValidUTCOffset(value.utcOffset) && require_convert_C8LsoKmI.isNonEmptyString(value.timeZoneName) && (require_convert_C8LsoKmI.isNonEmptyString(value.timeZoneId) || require_convert_C8LsoKmI.isValidArray(value.timeZoneId));
198
196
  }
199
197
 
200
198
  //#endregion
@@ -15,12 +15,10 @@
15
15
  */
16
16
 
17
17
  import { c as MONTHS, d as SORTED_TIME_FORMATS, i as BN_SEASONS, o as DAYS, r as BN_MONTH_TABLES, u as MS_PER_DAY } from "./basic-DqKyujoj.mjs";
18
- import { i as isString, n as isNonEmptyString } from "./primitives-BXhrgs9R.mjs";
19
- import { a as isValidArray, i as isObjectWithKeys } from "./non-primitives-CbAOB6lb.mjs";
20
- import { t as getOrdinal } from "./utilities-BnHD2hHf.mjs";
18
+ import { d as isValidArray, g as isString, m as isNonEmptyString, r as getOrdinal, u as isObjectWithKeys } from "./convert-C8LsoKmI-Blf3eLS6.mjs";
21
19
  import { isDate, isDateString, isLeapYear, isValidUTCOffset } from "./guards.mjs";
22
20
 
23
- //#region src/utils/helpers.ts
21
+ //#region src/utilities/helpers.ts
24
22
  /** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
25
23
  function _formatDateCore(format, dateComponents) {
26
24
  const tokenRegex = new RegExp(`^(${SORTED_TIME_FORMATS.join("|")})`);
package/dist/index.cjs CHANGED
@@ -16,13 +16,12 @@
16
16
 
17
17
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
18
18
  const require_basic = require('./basic-DsQqC5nZ.cjs');
19
- const require_primitives = require('./primitives-DfO90c3G.cjs');
20
- const require_non_primitives = require('./non-primitives-BqjRwK2B.cjs');
19
+ const require_convert_C8LsoKmI = require('./convert-C8LsoKmI-uBhT5hZQ.cjs');
21
20
  const require_guards = require('./guards.cjs');
22
- const require_helpers = require('./helpers-Bq7Hczoa.cjs');
23
- const require_utilities = require('./utilities-CCnKWAsS.cjs');
21
+ const require_helpers = require('./helpers-BMDeRLjO.cjs');
22
+ const require_utils = require('./utils-S_aw0TeC.cjs');
24
23
 
25
- //#region src/utils/chronos-fn.ts
24
+ //#region src/utilities/chronos-fn.ts
26
25
  /**
27
26
  * * Converts a date into a Chronos object and access to all `Chronos` methods and properties.
28
27
  *
@@ -77,7 +76,7 @@ const require_utilities = require('./utilities-CCnKWAsS.cjs');
77
76
  * ```
78
77
  */
79
78
  const $chronos = (valueOrYear, month, date, hours, minutes, seconds, ms) => {
80
- if (require_primitives.isNumber(valueOrYear) && require_primitives.isNumber(month)) return new Chronos(valueOrYear, month, date ?? 1, hours ?? 0, minutes ?? 0, seconds ?? 0, ms ?? 0);
79
+ if (require_convert_C8LsoKmI.isNumber(valueOrYear) && require_convert_C8LsoKmI.isNumber(month)) return new Chronos(valueOrYear, month, date ?? 1, hours ?? 0, minutes ?? 0, seconds ?? 0, ms ?? 0);
81
80
  else return new Chronos(valueOrYear);
82
81
  };
83
82
  /**
@@ -87,7 +86,7 @@ const $chronos = (valueOrYear, month, date, hours, minutes, seconds, ms) => {
87
86
  * @returns `true` if the property is a static method of `Chronos`, `false` otherwise.
88
87
  */
89
88
  function _isChronosStaticKey(prop) {
90
- return prop in Chronos && prop !== "prototype" && prop !== "name" && prop !== "length" && require_non_primitives.isFunction(Chronos[prop]);
89
+ return prop in Chronos && prop !== "prototype" && prop !== "name" && prop !== "length" && require_convert_C8LsoKmI.isFunction(Chronos[prop]);
91
90
  }
92
91
  /**
93
92
  * * Use `chronos` with all static methods from the `Chronos` class.
@@ -251,7 +250,7 @@ var Chronos = class Chronos {
251
250
  * @returns Instance of `Chronos` with all methods and properties.
252
251
  */
253
252
  constructor(valueOrYear, month, date, hours, minutes, seconds, ms) {
254
- if (require_primitives.isNumber(valueOrYear) && require_primitives.isNumber(month)) {
253
+ if (require_convert_C8LsoKmI.isNumber(valueOrYear) && require_convert_C8LsoKmI.isNumber(month)) {
255
254
  this.#date = new Date(valueOrYear, month - 1, date ?? 1, hours ?? 0, minutes ?? 0, seconds ?? 0, ms ?? 0);
256
255
  this.native = this.#date;
257
256
  } else {
@@ -318,7 +317,7 @@ var Chronos = class Chronos {
318
317
  * @returns The resolved time zone name or its IANA identifier as a fallback.
319
318
  */
320
319
  $getNativeTimeZoneName(tzId) {
321
- const $tzId = tzId || require_utilities.getNativeTimeZoneId();
320
+ const $tzId = tzId || require_utils.getNativeTimeZoneId();
322
321
  return require_helpers._resolveNativeTzName($tzId, "long", this.#date) ?? $tzId;
323
322
  }
324
323
  /**
@@ -332,7 +331,7 @@ var Chronos = class Chronos {
332
331
  * @returns The local system's IANA time zone identifier.
333
332
  */
334
333
  $getNativeTimeZoneId() {
335
- return require_utilities.getNativeTimeZoneId();
334
+ return require_utils.getNativeTimeZoneId();
336
335
  }
337
336
  /** Get timestamp (milliseconds since midnight, January 1, 1970 UTC) of the current instance, not the true `Date`. */
338
337
  get #timestamp() {
@@ -477,7 +476,7 @@ var Chronos = class Chronos {
477
476
  }
478
477
  /** @instance Gets the native `Date` instance of the current `Chronos`. */
479
478
  toDate() {
480
- const adjustmentMs = (require_utilities.extractMinutesFromUTC(this.#offset) - this.getUTCOffsetMinutes()) * 6e4;
479
+ const adjustmentMs = (require_utils.extractMinutesFromUTC(this.#offset) - this.getUTCOffsetMinutes()) * 6e4;
481
480
  return new Date(this.#timestamp - adjustmentMs);
482
481
  }
483
482
  /** @instance Returns a string representation of a date. */
@@ -1074,7 +1073,7 @@ var Chronos = class Chronos {
1074
1073
  * @returns The timezone offset in minutes maintaining the current timezone regardless of system having different one.
1075
1074
  */
1076
1075
  getTimeZoneOffsetMinutes() {
1077
- return require_utilities.extractMinutesFromUTC(this.#offset);
1076
+ return require_utils.extractMinutesFromUTC(this.#offset);
1078
1077
  }
1079
1078
  /** @instance Returns new `Chronos` instance in UTC time */
1080
1079
  toUTC() {
@@ -1372,7 +1371,7 @@ var Chronos = class Chronos {
1372
1371
  */
1373
1372
  static isLeapYear(date) {
1374
1373
  let year;
1375
- if (require_primitives.isNumber(date)) if (date > 0 && date <= 9999) year = date;
1374
+ if (require_convert_C8LsoKmI.isNumber(date)) if (date > 0 && date <= 9999) year = date;
1376
1375
  else year = new Date(date).getFullYear();
1377
1376
  else year = Chronos.#cast(date).year;
1378
1377
  return require_guards.isLeapYear(year);
@@ -1427,7 +1426,7 @@ var Chronos = class Chronos {
1427
1426
  static reconstruct(value) {
1428
1427
  if (!require_helpers._hasChronosProperties(value)) throw new TypeError("Invalid input for reconstruction!");
1429
1428
  const { native, origin, utcOffset, timeZoneName, timeZoneId, $tzTracker } = value;
1430
- const offsetMins = require_utilities.extractMinutesFromUTC(utcOffset);
1429
+ const offsetMins = require_utils.extractMinutesFromUTC(utcOffset);
1431
1430
  const chr = new Chronos(native);
1432
1431
  const diffMins = chr.getTimeZoneOffsetMinutes() - offsetMins;
1433
1432
  return (chr.utcOffset === utcOffset ? chr : chr.add(-diffMins, "minute")).#withOrigin(origin, utcOffset, timeZoneName, timeZoneId, $tzTracker);
package/dist/index.d.cts CHANGED
@@ -15,5 +15,5 @@
15
15
  */
16
16
 
17
17
  import { D as INTERNALS } from "./seasons-CpUn45n6.cjs";
18
- import { Ht as chronos, Vt as Chronos } from "./types-dNpvroNQ.cjs";
18
+ import { Ht as chronos, Vt as Chronos } from "./types-zhhEJ8N7.cjs";
19
19
  export { Chronos, INTERNALS, chronos };
package/dist/index.d.mts CHANGED
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { D as INTERNALS } from "./seasons-B_kjFWIX.mjs";
18
- import { Ht as chronos, Vt as Chronos } from "./types-Be4ZMpOV.mjs";
17
+ import { D as INTERNALS } from "./seasons-DYk2jvtn.mjs";
18
+ import { Ht as chronos, Vt as Chronos } from "./types-CiFnGEL8.mjs";
19
19
  export { Chronos, INTERNALS, chronos };
package/dist/index.mjs CHANGED
@@ -15,13 +15,12 @@
15
15
  */
16
16
 
17
17
  import { c as MONTHS, o as DAYS, s as INTERNALS, u as MS_PER_DAY } from "./basic-DqKyujoj.mjs";
18
- import { r as isNumber } from "./primitives-BXhrgs9R.mjs";
19
- import { t as isFunction } from "./non-primitives-CbAOB6lb.mjs";
18
+ import { h as isNumber, o as isFunction } from "./convert-C8LsoKmI-Blf3eLS6.mjs";
20
19
  import { isDateString, isLeapYear } from "./guards.mjs";
21
- import { c as _hasChronosProperties, n as _dateArgsToDate, p as _resolveNativeTzName, r as _formatDate, u as _normalizeOffset } from "./helpers-C2spzGZ-.mjs";
22
- import { l as getNativeTimeZoneId, r as extractMinutesFromUTC } from "./utilities-C6NiChRE.mjs";
20
+ import { c as _hasChronosProperties, n as _dateArgsToDate, p as _resolveNativeTzName, r as _formatDate, u as _normalizeOffset } from "./helpers-t49KkxOE.mjs";
21
+ import { l as getNativeTimeZoneId, r as extractMinutesFromUTC } from "./utils-DBy7S7hH.mjs";
23
22
 
24
- //#region src/utils/chronos-fn.ts
23
+ //#region src/utilities/chronos-fn.ts
25
24
  /**
26
25
  * * Converts a date into a Chronos object and access to all `Chronos` methods and properties.
27
26
  *