bn-calendar 1.2.3 → 1.2.6
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 +1 -1
- package/dist/dist-2u-Hm2TM.cjs +303 -0
- package/dist/dist-CL82Iohb.mjs +255 -0
- package/dist/index.cjs +30 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +11 -3
- package/dist/{types-DNIQWvTX.d.mts → object-DyVg8BFt-DFzPgPEP.d.cts} +81 -37
- package/dist/{types-D3WdI9_e.d.cts → object-DyVg8BFt-DFzPgPEP.d.mts} +81 -37
- package/dist/{types-L7OC1yyG.d.cts → types-BhqpTl07.d.cts} +1 -1
- package/dist/{types-B8dz3JYA.d.mts → types-CuBrWmN0.d.mts} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.cts +13 -4
- package/dist/utils.d.mts +13 -4
- package/dist/utils.mjs +1 -1
- package/package.json +14 -12
- package/dist/convert-B3CETM-p.mjs +0 -96
- package/dist/convert-CuE2E2-u.cjs +0 -144
package/dist/index.cjs
CHANGED
|
@@ -15,11 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
|
-
const
|
|
18
|
+
const require_dist = require('./dist-2u-Hm2TM.cjs');
|
|
19
19
|
|
|
20
|
-
//#region node_modules/.pnpm/
|
|
20
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/guards-DBunDnng.mjs
|
|
21
|
+
/**
|
|
22
|
+
* * Checks if the year is a leap year.
|
|
23
|
+
*
|
|
24
|
+
* - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
|
|
25
|
+
* - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.
|
|
26
|
+
* @param year The year to check.
|
|
27
|
+
* @returns `true` if the year is a leap year, `false` otherwise.
|
|
28
|
+
*/
|
|
21
29
|
function isLeapYear(year) {
|
|
22
|
-
const $year =
|
|
30
|
+
const $year = require_dist.normalizeNumber(year);
|
|
23
31
|
return $year ? $year % 4 === 0 && $year % 100 !== 0 || $year % 400 === 0 : false;
|
|
24
32
|
}
|
|
25
33
|
|
|
@@ -408,17 +416,17 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
408
416
|
/** * Creates a `BanglaCalendar` instance based on given parameter(s) */
|
|
409
417
|
constructor(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config) {
|
|
410
418
|
this.variant = this.#processVariants(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config);
|
|
411
|
-
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : new Date(
|
|
412
|
-
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
419
|
+
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : new Date(require_dist.isDateString(dateBnYrOrCfg) && !BanglaCalendar.isBanglaDateString(dateBnYrOrCfg) ? dateBnYrOrCfg : require_dist.isNumber(dateBnYrOrCfg) && !BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : Date.now());
|
|
420
|
+
if (Number.isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
413
421
|
const { year, month, monthDate } = this.#processDate(date);
|
|
414
|
-
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ?
|
|
415
|
-
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ?
|
|
416
|
-
let bnDate = BanglaCalendar.isBanglaDate(bnDateOrCfg) ?
|
|
422
|
+
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ? require_dist.banglaToDigit(dateBnYrOrCfg) : require_dist.isNumber(dateBnYrOrCfg) && BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : year;
|
|
423
|
+
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ? require_dist.banglaToDigit(bnMonthOrCfg) : BanglaCalendar.isBanglaMonthEn(bnMonthOrCfg) ? bnMonthOrCfg : month;
|
|
424
|
+
let bnDate = BanglaCalendar.isBanglaDate(bnDateOrCfg) ? require_dist.banglaToDigit(bnDateOrCfg) : BanglaCalendar.isBanglaDateEn(bnDateOrCfg) ? bnDateOrCfg : monthDate;
|
|
417
425
|
if (BanglaCalendar.isBanglaDateString(dateBnYrOrCfg)) {
|
|
418
426
|
const parts = dateBnYrOrCfg.replace(/['"]/g, "").split("-");
|
|
419
|
-
bnYear =
|
|
420
|
-
bnMonth =
|
|
421
|
-
bnDate =
|
|
427
|
+
bnYear = require_dist.banglaToDigit(parts[0]);
|
|
428
|
+
bnMonth = require_dist.banglaToDigit(parts[1]);
|
|
429
|
+
bnDate = require_dist.banglaToDigit(parts[2]);
|
|
422
430
|
}
|
|
423
431
|
const { gregYear } = this.#processGregYear(bnYear, bnMonth);
|
|
424
432
|
const { bnMonthTable } = this.#getBnMonthTableLeap(gregYear, bnYear);
|
|
@@ -431,15 +439,15 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
431
439
|
} else bnMonth += 1;
|
|
432
440
|
}
|
|
433
441
|
this.year = {
|
|
434
|
-
bn:
|
|
442
|
+
bn: require_dist.digitToBangla(bnYear),
|
|
435
443
|
en: bnYear
|
|
436
444
|
};
|
|
437
445
|
this.month = {
|
|
438
|
-
bn:
|
|
446
|
+
bn: require_dist.digitToBangla(bnMonth),
|
|
439
447
|
en: bnMonth
|
|
440
448
|
};
|
|
441
449
|
this.date = {
|
|
442
|
-
bn:
|
|
450
|
+
bn: require_dist.digitToBangla(bnDate),
|
|
443
451
|
en: bnDate
|
|
444
452
|
};
|
|
445
453
|
const { gy, gm, gd, wd } = _extractDateUnits(this.toDate());
|
|
@@ -994,7 +1002,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
994
1002
|
* @returns `true` if the value contains a valid {@link variant} property, `false` otherwise
|
|
995
1003
|
*/
|
|
996
1004
|
$hasVariantConfig(value) {
|
|
997
|
-
return
|
|
1005
|
+
return require_dist.isObjectWithKeys(value, ["variant"]) && require_dist.isNonEmptyString(value.variant) && (value.variant === "revised-1966" || value.variant === "revised-2019");
|
|
998
1006
|
}
|
|
999
1007
|
/**
|
|
1000
1008
|
* @static Checks whether a value is a valid Bangla year in Bangla digits (`০–৯৯৯৯`).
|
|
@@ -1009,7 +1017,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1009
1017
|
* BanglaCalendar.isBanglaYear('1430'); // false (Latin digits)
|
|
1010
1018
|
*/
|
|
1011
1019
|
static isBanglaYear(value) {
|
|
1012
|
-
return
|
|
1020
|
+
return require_dist.isNonEmptyString(value) && /^(?:০{0,3}[১-৯][০-৯]{0,3}|০)$/.test(value.trim());
|
|
1013
1021
|
}
|
|
1014
1022
|
/**
|
|
1015
1023
|
* @static Checks whether a value is a valid Bangla year in Latin digits (`0–9999`).
|
|
@@ -1024,7 +1032,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1024
1032
|
* BanglaCalendar.isBanglaYearEn(-1); // false
|
|
1025
1033
|
*/
|
|
1026
1034
|
static isBanglaYearEn(value) {
|
|
1027
|
-
return
|
|
1035
|
+
return require_dist.isInteger(value) && value >= 0 && value <= 9999;
|
|
1028
1036
|
}
|
|
1029
1037
|
/**
|
|
1030
1038
|
* @static Checks whether a value is a valid Bangla month in Bangla digits (`১–১২`).
|
|
@@ -1039,7 +1047,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1039
1047
|
* BanglaCalendar.isBanglaMonth('0'); // false (Latin digit)
|
|
1040
1048
|
*/
|
|
1041
1049
|
static isBanglaMonth(value) {
|
|
1042
|
-
return
|
|
1050
|
+
return require_dist.isNonEmptyString(value) && /^(?:০?[১-৯]|১০|১১|১২)$/.test(value.trim());
|
|
1043
1051
|
}
|
|
1044
1052
|
/**
|
|
1045
1053
|
* @static Checks whether a value is a valid Bangla month in Latin digits (`1–12`).
|
|
@@ -1054,7 +1062,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1054
1062
|
* BanglaCalendar.isBanglaMonthEn(13); // false
|
|
1055
1063
|
*/
|
|
1056
1064
|
static isBanglaMonthEn(value) {
|
|
1057
|
-
return
|
|
1065
|
+
return require_dist.isInteger(value) && value >= 1 && value <= 12;
|
|
1058
1066
|
}
|
|
1059
1067
|
/**
|
|
1060
1068
|
* @static Checks whether a value is a valid Bangla date of month in Bangla digits (`১–৩১`).
|
|
@@ -1069,7 +1077,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1069
1077
|
* BanglaCalendar.isBanglaDate('০'); // false
|
|
1070
1078
|
*/
|
|
1071
1079
|
static isBanglaDate(value) {
|
|
1072
|
-
return
|
|
1080
|
+
return require_dist.isNonEmptyString(value) && /^(?:০?[১-৯]|[১২][০-৯]|৩০|৩১)$/.test(value.trim());
|
|
1073
1081
|
}
|
|
1074
1082
|
/**
|
|
1075
1083
|
* @static Checks whether a value is a valid Bangla date of month in Latin digits (`1–31`).
|
|
@@ -1084,7 +1092,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1084
1092
|
* BanglaCalendar.isBanglaDateEn(0); // false
|
|
1085
1093
|
*/
|
|
1086
1094
|
static isBanglaDateEn(value) {
|
|
1087
|
-
return
|
|
1095
|
+
return require_dist.isInteger(value) && value >= 1 && value <= 31;
|
|
1088
1096
|
}
|
|
1089
1097
|
/**
|
|
1090
1098
|
* @static Checks whether a string follows the Bangla date format pattern (`YYYY-MM-DD` with Bangla digits).
|
|
@@ -1104,7 +1112,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1104
1112
|
* - Year must be `০-৯৯৯৯`, month must be `১-১২`, date must be `১-৩১`
|
|
1105
1113
|
*/
|
|
1106
1114
|
static isBanglaDateString(value) {
|
|
1107
|
-
if (
|
|
1115
|
+
if (require_dist.isNonEmptyString(value) && value.includes("-")) {
|
|
1108
1116
|
const [year, month, date] = value.replace(/['"]/g, "").split("-");
|
|
1109
1117
|
return BanglaCalendar.isBanglaYear(year) && BanglaCalendar.isBanglaMonth(month) && BanglaCalendar.isBanglaDate(date);
|
|
1110
1118
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as
|
|
18
|
-
import { _ as BnCalendarConfig, a as $BnEn, c as BanglaDate, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, l as BanglaDateFormat, m as BanglaMonthName, p as BanglaMonth, v as BnCalendarVariant } from "./types-
|
|
17
|
+
import { a as Enumerate, s as NumberRange } from "./object-DyVg8BFt-DFzPgPEP.cjs";
|
|
18
|
+
import { _ as BnCalendarConfig, a as $BnEn, c as BanglaDate, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, l as BanglaDateFormat, m as BanglaMonthName, p as BanglaMonth, v as BnCalendarVariant } from "./types-BhqpTl07.cjs";
|
|
19
19
|
|
|
20
20
|
//#region src/BanglaCalendar.d.ts
|
|
21
21
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as
|
|
18
|
-
import { _ as BnCalendarConfig, a as $BnEn, c as BanglaDate, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, l as BanglaDateFormat, m as BanglaMonthName, p as BanglaMonth, v as BnCalendarVariant } from "./types-
|
|
17
|
+
import { a as Enumerate, s as NumberRange } from "./object-DyVg8BFt-DFzPgPEP.mjs";
|
|
18
|
+
import { _ as BnCalendarConfig, a as $BnEn, c as BanglaDate, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, l as BanglaDateFormat, m as BanglaMonthName, p as BanglaMonth, v as BnCalendarVariant } from "./types-CuBrWmN0.mjs";
|
|
19
19
|
|
|
20
20
|
//#region src/BanglaCalendar.d.ts
|
|
21
21
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { a as isObjectWithKeys, c as isNumber, i as isDateString, n as digitToBangla, o as isInteger, r as normalizeNumber, s as isNonEmptyString, t as banglaToDigit } from "./
|
|
17
|
+
import { a as isObjectWithKeys, c as isNumber, i as isDateString, n as digitToBangla, o as isInteger, r as normalizeNumber, s as isNonEmptyString, t as banglaToDigit } from "./dist-CL82Iohb.mjs";
|
|
18
18
|
|
|
19
|
-
//#region node_modules/.pnpm/
|
|
19
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/guards-DBunDnng.mjs
|
|
20
|
+
/**
|
|
21
|
+
* * Checks if the year is a leap year.
|
|
22
|
+
*
|
|
23
|
+
* - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
|
|
24
|
+
* - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.
|
|
25
|
+
* @param year The year to check.
|
|
26
|
+
* @returns `true` if the year is a leap year, `false` otherwise.
|
|
27
|
+
*/
|
|
20
28
|
function isLeapYear(year) {
|
|
21
29
|
const $year = normalizeNumber(year);
|
|
22
30
|
return $year ? $year % 4 === 0 && $year % 100 !== 0 || $year % 400 === 0 : false;
|
|
@@ -408,7 +416,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
408
416
|
constructor(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config) {
|
|
409
417
|
this.variant = this.#processVariants(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config);
|
|
410
418
|
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : new Date(isDateString(dateBnYrOrCfg) && !BanglaCalendar.isBanglaDateString(dateBnYrOrCfg) ? dateBnYrOrCfg : isNumber(dateBnYrOrCfg) && !BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : Date.now());
|
|
411
|
-
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
419
|
+
if (Number.isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
412
420
|
const { year, month, monthDate } = this.#processDate(date);
|
|
413
421
|
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ? banglaToDigit(dateBnYrOrCfg) : isNumber(dateBnYrOrCfg) && BanglaCalendar.isBanglaYearEn(dateBnYrOrCfg) ? dateBnYrOrCfg : year;
|
|
414
422
|
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ? banglaToDigit(bnMonthOrCfg) : BanglaCalendar.isBanglaMonthEn(bnMonthOrCfg) ? bnMonthOrCfg : month;
|
|
@@ -14,7 +14,43 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/
|
|
17
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/object-DyVg8BFt.d.mts
|
|
18
|
+
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
19
|
+
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
20
|
+
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
21
|
+
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
22
|
+
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
23
|
+
declare const BN_DIGITS: Readonly<{
|
|
24
|
+
readonly '\u09E6': 0;
|
|
25
|
+
readonly '\u09E7': 1;
|
|
26
|
+
readonly '\u09E8': 2;
|
|
27
|
+
readonly '\u09E9': 3;
|
|
28
|
+
readonly '\u09EA': 4;
|
|
29
|
+
readonly '\u09EB': 5;
|
|
30
|
+
readonly '\u09EC': 6;
|
|
31
|
+
readonly '\u09ED': 7;
|
|
32
|
+
readonly '\u09EE': 8;
|
|
33
|
+
readonly '\u09EF': 9;
|
|
34
|
+
}>; //#endregion
|
|
35
|
+
//#region src/number/Unit.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* @class Class to handle conversions between various types of units.
|
|
38
|
+
*
|
|
39
|
+
* Includes static methods for:
|
|
40
|
+
* - Length: meters, feet, kilometers, miles
|
|
41
|
+
* - Mass: kilograms, pounds, grams, ounces
|
|
42
|
+
* - Temperature: Celsius, Fahrenheit, Kelvin
|
|
43
|
+
* - Volume: liters, gallons
|
|
44
|
+
* - Area: square meters, square feet
|
|
45
|
+
* - Speed: km/h, mph
|
|
46
|
+
* - Time: hours, minutes, seconds, days
|
|
47
|
+
* - Digital Storage: kilobytes, megabytes, gigabytes
|
|
48
|
+
* - Energy: joules, calories
|
|
49
|
+
* - Pressure: atm, pascals
|
|
50
|
+
* - Frequency: Hz, kHz
|
|
51
|
+
*
|
|
52
|
+
* @remarks For more robust unit conversion, please use the `Converter` function which provides category-specific conversion classes.
|
|
53
|
+
*/
|
|
18
54
|
/**
|
|
19
55
|
* * Broadens a literal union (typically `string` or `number`) to also accept any other value of the base type, without losing IntelliSense autocomplete for the provided literals.
|
|
20
56
|
*
|
|
@@ -41,8 +77,19 @@
|
|
|
41
77
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
42
78
|
*/
|
|
43
79
|
type LooseLiteral<T extends string | number> = T | (T extends string ? string & {} : number & {});
|
|
80
|
+
/**
|
|
81
|
+
* * Extracts an object type containing only the optional keys from `T`.
|
|
82
|
+
*
|
|
83
|
+
* @typeParam T - The original object type
|
|
84
|
+
* @returns A new object type with only optional keys from `T`
|
|
85
|
+
* @example
|
|
86
|
+
* type Example = { a: string; b?: number; c?: boolean };
|
|
87
|
+
* type OptionalPart = ExtractOptional<Example>;
|
|
88
|
+
* // { b?: number; c?: boolean }
|
|
89
|
+
*/
|
|
44
90
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
45
91
|
type $BuildTuple<L extends number, T extends unknown[] = []> = T['length'] extends L ? T : $BuildTuple<L, [...T, unknown]>;
|
|
92
|
+
/** * Produce a union of numbers `From | From+1 | ... | To`. */
|
|
46
93
|
/**
|
|
47
94
|
* Recursively join the string S for each element in the tuple A.
|
|
48
95
|
* Returns an empty string for an empty tuple.
|
|
@@ -61,41 +108,23 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
61
108
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
62
109
|
*/
|
|
63
110
|
type Repeat<S extends string, N extends number> = $JoinRepeat<S, $BuildTuple<N>>;
|
|
111
|
+
/**
|
|
112
|
+
* * Replace all occurrences of substring `Search` in `Str` with `With`.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* type Dash = Replace<'hello world', ' ', '-'>; // "hello-world"
|
|
116
|
+
*
|
|
117
|
+
* type Underscore = Replace<'a-b-c', '-', '_'>; // "a_b_c"
|
|
118
|
+
*
|
|
119
|
+
* type NoSpaces = Replace<' spaced out ', ' ', ''>; // "spacedout"
|
|
120
|
+
*
|
|
121
|
+
* @remarks **Notes:**
|
|
122
|
+
* - Works recursively to replace **all** occurrences of `Search`.
|
|
123
|
+
* - If `Search` does not exist in `Str`, returns `Str` unchanged.
|
|
124
|
+
* - `Str`, `Search` (Default is space `" "`) and `With` (Default is `"-"`) must be literal string types.
|
|
125
|
+
*/
|
|
64
126
|
//#endregion
|
|
65
|
-
//#region
|
|
66
|
-
/** Year in either 4 or 2 digits format */
|
|
67
|
-
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
68
|
-
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
69
|
-
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
70
|
-
/** Day in either 2 letters or full word format */
|
|
71
|
-
type DayToken = (typeof DAY_FORMATS)[number];
|
|
72
|
-
/** Date in either 1 or 2 digits format */
|
|
73
|
-
type DateToken = (typeof DATE_FORMATS)[number];
|
|
74
|
-
/** Standard date formats. */
|
|
75
|
-
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/date/constants.d.ts
|
|
78
|
-
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
79
|
-
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
80
|
-
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
81
|
-
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/constants.d.ts
|
|
84
|
-
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
85
|
-
declare const BN_DIGITS: Readonly<{
|
|
86
|
-
readonly '\u09E6': 0;
|
|
87
|
-
readonly '\u09E7': 1;
|
|
88
|
-
readonly '\u09E8': 2;
|
|
89
|
-
readonly '\u09E9': 3;
|
|
90
|
-
readonly '\u09EA': 4;
|
|
91
|
-
readonly '\u09EB': 5;
|
|
92
|
-
readonly '\u09EC': 6;
|
|
93
|
-
readonly '\u09ED': 7;
|
|
94
|
-
readonly '\u09EE': 8;
|
|
95
|
-
readonly '\u09EF': 9;
|
|
96
|
-
}>;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/types.d.ts
|
|
127
|
+
//#region src/types/number.d.ts
|
|
99
128
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
100
129
|
type $EnumerateInternal<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : $EnumerateInternal<N, [...Acc, Acc['length']]>;
|
|
101
130
|
/**
|
|
@@ -128,11 +157,26 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
128
157
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
129
158
|
*/
|
|
130
159
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
+
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
131
161
|
/** Bangla digits from `০-৯` */
|
|
132
162
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
133
163
|
/** Bangla digits from `১-৯` */
|
|
134
164
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
135
165
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
136
|
-
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
166
|
+
type BnDigitResult<Force extends boolean> = Force extends true ? number : string; //#endregion
|
|
167
|
+
//#region src/types/date.d.ts
|
|
168
|
+
/** - Minute in numeric string from `00` to `23` */
|
|
169
|
+
/** Year in either 4 or 2 digits format */
|
|
170
|
+
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
171
|
+
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
172
|
+
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
173
|
+
/** Day in either 2 letters or full word format */
|
|
174
|
+
type DayToken = (typeof DAY_FORMATS)[number];
|
|
175
|
+
/** Date in either 1 or 2 digits format */
|
|
176
|
+
type DateToken = (typeof DATE_FORMATS)[number];
|
|
177
|
+
/** Second in either 1 or 2 digits format */
|
|
178
|
+
/** Standard date formats. */
|
|
179
|
+
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
180
|
+
/** Standard Time Formats */
|
|
137
181
|
//#endregion
|
|
138
|
-
export {
|
|
182
|
+
export { Enumerate as a, Repeat as c, DateFormatToken as i, BanglaDigit as n, LooseLiteral as o, BnDigitResult as r, NumberRange as s, $BnOnes as t };
|
|
@@ -14,7 +14,43 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
//#region node_modules/.pnpm/
|
|
17
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/object-DyVg8BFt.d.mts
|
|
18
|
+
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
19
|
+
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
20
|
+
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
21
|
+
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
22
|
+
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
23
|
+
declare const BN_DIGITS: Readonly<{
|
|
24
|
+
readonly '\u09E6': 0;
|
|
25
|
+
readonly '\u09E7': 1;
|
|
26
|
+
readonly '\u09E8': 2;
|
|
27
|
+
readonly '\u09E9': 3;
|
|
28
|
+
readonly '\u09EA': 4;
|
|
29
|
+
readonly '\u09EB': 5;
|
|
30
|
+
readonly '\u09EC': 6;
|
|
31
|
+
readonly '\u09ED': 7;
|
|
32
|
+
readonly '\u09EE': 8;
|
|
33
|
+
readonly '\u09EF': 9;
|
|
34
|
+
}>; //#endregion
|
|
35
|
+
//#region src/number/Unit.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* @class Class to handle conversions between various types of units.
|
|
38
|
+
*
|
|
39
|
+
* Includes static methods for:
|
|
40
|
+
* - Length: meters, feet, kilometers, miles
|
|
41
|
+
* - Mass: kilograms, pounds, grams, ounces
|
|
42
|
+
* - Temperature: Celsius, Fahrenheit, Kelvin
|
|
43
|
+
* - Volume: liters, gallons
|
|
44
|
+
* - Area: square meters, square feet
|
|
45
|
+
* - Speed: km/h, mph
|
|
46
|
+
* - Time: hours, minutes, seconds, days
|
|
47
|
+
* - Digital Storage: kilobytes, megabytes, gigabytes
|
|
48
|
+
* - Energy: joules, calories
|
|
49
|
+
* - Pressure: atm, pascals
|
|
50
|
+
* - Frequency: Hz, kHz
|
|
51
|
+
*
|
|
52
|
+
* @remarks For more robust unit conversion, please use the `Converter` function which provides category-specific conversion classes.
|
|
53
|
+
*/
|
|
18
54
|
/**
|
|
19
55
|
* * Broadens a literal union (typically `string` or `number`) to also accept any other value of the base type, without losing IntelliSense autocomplete for the provided literals.
|
|
20
56
|
*
|
|
@@ -41,8 +77,19 @@
|
|
|
41
77
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
42
78
|
*/
|
|
43
79
|
type LooseLiteral<T extends string | number> = T | (T extends string ? string & {} : number & {});
|
|
80
|
+
/**
|
|
81
|
+
* * Extracts an object type containing only the optional keys from `T`.
|
|
82
|
+
*
|
|
83
|
+
* @typeParam T - The original object type
|
|
84
|
+
* @returns A new object type with only optional keys from `T`
|
|
85
|
+
* @example
|
|
86
|
+
* type Example = { a: string; b?: number; c?: boolean };
|
|
87
|
+
* type OptionalPart = ExtractOptional<Example>;
|
|
88
|
+
* // { b?: number; c?: boolean }
|
|
89
|
+
*/
|
|
44
90
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
45
91
|
type $BuildTuple<L extends number, T extends unknown[] = []> = T['length'] extends L ? T : $BuildTuple<L, [...T, unknown]>;
|
|
92
|
+
/** * Produce a union of numbers `From | From+1 | ... | To`. */
|
|
46
93
|
/**
|
|
47
94
|
* Recursively join the string S for each element in the tuple A.
|
|
48
95
|
* Returns an empty string for an empty tuple.
|
|
@@ -61,41 +108,23 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
61
108
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
62
109
|
*/
|
|
63
110
|
type Repeat<S extends string, N extends number> = $JoinRepeat<S, $BuildTuple<N>>;
|
|
111
|
+
/**
|
|
112
|
+
* * Replace all occurrences of substring `Search` in `Str` with `With`.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* type Dash = Replace<'hello world', ' ', '-'>; // "hello-world"
|
|
116
|
+
*
|
|
117
|
+
* type Underscore = Replace<'a-b-c', '-', '_'>; // "a_b_c"
|
|
118
|
+
*
|
|
119
|
+
* type NoSpaces = Replace<' spaced out ', ' ', ''>; // "spacedout"
|
|
120
|
+
*
|
|
121
|
+
* @remarks **Notes:**
|
|
122
|
+
* - Works recursively to replace **all** occurrences of `Search`.
|
|
123
|
+
* - If `Search` does not exist in `Str`, returns `Str` unchanged.
|
|
124
|
+
* - `Str`, `Search` (Default is space `" "`) and `With` (Default is `"-"`) must be literal string types.
|
|
125
|
+
*/
|
|
64
126
|
//#endregion
|
|
65
|
-
//#region
|
|
66
|
-
/** Year in either 4 or 2 digits format */
|
|
67
|
-
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
68
|
-
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
69
|
-
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
70
|
-
/** Day in either 2 letters or full word format */
|
|
71
|
-
type DayToken = (typeof DAY_FORMATS)[number];
|
|
72
|
-
/** Date in either 1 or 2 digits format */
|
|
73
|
-
type DateToken = (typeof DATE_FORMATS)[number];
|
|
74
|
-
/** Standard date formats. */
|
|
75
|
-
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/date/constants.d.ts
|
|
78
|
-
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
79
|
-
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
80
|
-
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
81
|
-
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/constants.d.ts
|
|
84
|
-
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
85
|
-
declare const BN_DIGITS: Readonly<{
|
|
86
|
-
readonly '\u09E6': 0;
|
|
87
|
-
readonly '\u09E7': 1;
|
|
88
|
-
readonly '\u09E8': 2;
|
|
89
|
-
readonly '\u09E9': 3;
|
|
90
|
-
readonly '\u09EA': 4;
|
|
91
|
-
readonly '\u09EB': 5;
|
|
92
|
-
readonly '\u09EC': 6;
|
|
93
|
-
readonly '\u09ED': 7;
|
|
94
|
-
readonly '\u09EE': 8;
|
|
95
|
-
readonly '\u09EF': 9;
|
|
96
|
-
}>;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/types.d.ts
|
|
127
|
+
//#region src/types/number.d.ts
|
|
99
128
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
100
129
|
type $EnumerateInternal<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : $EnumerateInternal<N, [...Acc, Acc['length']]>;
|
|
101
130
|
/**
|
|
@@ -128,11 +157,26 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
128
157
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
129
158
|
*/
|
|
130
159
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
+
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
131
161
|
/** Bangla digits from `০-৯` */
|
|
132
162
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
133
163
|
/** Bangla digits from `১-৯` */
|
|
134
164
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
135
165
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
136
|
-
type BnDigitResult<Force extends boolean> = Force extends true ? number : string;
|
|
166
|
+
type BnDigitResult<Force extends boolean> = Force extends true ? number : string; //#endregion
|
|
167
|
+
//#region src/types/date.d.ts
|
|
168
|
+
/** - Minute in numeric string from `00` to `23` */
|
|
169
|
+
/** Year in either 4 or 2 digits format */
|
|
170
|
+
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
171
|
+
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
172
|
+
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
173
|
+
/** Day in either 2 letters or full word format */
|
|
174
|
+
type DayToken = (typeof DAY_FORMATS)[number];
|
|
175
|
+
/** Date in either 1 or 2 digits format */
|
|
176
|
+
type DateToken = (typeof DATE_FORMATS)[number];
|
|
177
|
+
/** Second in either 1 or 2 digits format */
|
|
178
|
+
/** Standard date formats. */
|
|
179
|
+
type DateFormatToken = `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken}, ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>}, ${YearToken}` | `${DayToken}, ${Exclude<MonthToken, 'M' | 'MM'>} ${DateToken} ${YearToken}` | `${DayToken}, ${DateToken} ${Exclude<MonthToken, 'M' | 'MM'>} ${YearToken}` | `${Exclude<DateToken, 'Do'>}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${YearToken}` | `${YearToken}.${Exclude<MonthToken, 'mmm' | 'mmmm'>}.${Exclude<DateToken, 'Do'>}` | `${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${YearToken}` | `${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}/${YearToken}` | `${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}-${YearToken}` | `${YearToken}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}-${Exclude<DateToken, 'Do'>}` | `${YearToken}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}/${Exclude<DateToken, 'Do'>}` | `${YearToken}-${Exclude<DateToken, 'Do'>}-${Exclude<MonthToken, 'mmm' | 'mmmm'>}` | `${YearToken}/${Exclude<DateToken, 'Do'>}/${Exclude<MonthToken, 'mmm' | 'mmmm'>}`;
|
|
180
|
+
/** Standard Time Formats */
|
|
137
181
|
//#endregion
|
|
138
|
-
export {
|
|
182
|
+
export { Enumerate as a, Repeat as c, DateFormatToken as i, BanglaDigit as n, LooseLiteral as o, BnDigitResult as r, NumberRange as s, $BnOnes as t };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { c as Repeat, i as DateFormatToken, n as BanglaDigit, o as LooseLiteral, s as NumberRange, t as $BnOnes } from "./object-DyVg8BFt-DFzPgPEP.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/constants.d.ts
|
|
20
20
|
/** Bangla month days table for different variants */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { c as Repeat, i as DateFormatToken, n as BanglaDigit, o as LooseLiteral, s as NumberRange, t as $BnOnes } from "./object-DyVg8BFt-DFzPgPEP.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/constants.d.ts
|
|
20
20
|
/** Bangla month days table for different variants */
|
package/dist/types.d.cts
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { C as MSToken, D as TimeToken, E as SecondToken, O as YearToken, S as HourToken, T as MonthToken, _ as BnCalendarConfig, a as $BnEn, b as DateWithSeasonToken, c as BanglaDate, d as BanglaDateOptions, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, i as $BnDatePadded, l as BanglaDateFormat, m as BanglaMonthName, n as $BanglaMonthDate, o as $BnMonthPadded, p as BanglaMonth, r as $BanglaYear, s as $BnYearPadded, t as $BanglaMonth, u as BanglaDateObject, v as BnCalendarVariant, w as MinuteToken, x as DayToken, y as DateToken } from "./types-
|
|
17
|
+
import { C as MSToken, D as TimeToken, E as SecondToken, O as YearToken, S as HourToken, T as MonthToken, _ as BnCalendarConfig, a as $BnEn, b as DateWithSeasonToken, c as BanglaDate, d as BanglaDateOptions, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, i as $BnDatePadded, l as BanglaDateFormat, m as BanglaMonthName, n as $BanglaMonthDate, o as $BnMonthPadded, p as BanglaMonth, r as $BanglaYear, s as $BnYearPadded, t as $BanglaMonth, u as BanglaDateObject, v as BnCalendarVariant, w as MinuteToken, x as DayToken, y as DateToken } from "./types-BhqpTl07.cjs";
|
|
18
18
|
export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, DateToken, DateWithSeasonToken, DayToken, HourToken, MSToken, MinuteToken, MonthToken, SecondToken, TimeToken, YearToken };
|
package/dist/types.d.mts
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { C as MSToken, D as TimeToken, E as SecondToken, O as YearToken, S as HourToken, T as MonthToken, _ as BnCalendarConfig, a as $BnEn, b as DateWithSeasonToken, c as BanglaDate, d as BanglaDateOptions, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, i as $BnDatePadded, l as BanglaDateFormat, m as BanglaMonthName, n as $BanglaMonthDate, o as $BnMonthPadded, p as BanglaMonth, r as $BanglaYear, s as $BnYearPadded, t as $BanglaMonth, u as BanglaDateObject, v as BnCalendarVariant, w as MinuteToken, x as DayToken, y as DateToken } from "./types-
|
|
17
|
+
import { C as MSToken, D as TimeToken, E as SecondToken, O as YearToken, S as HourToken, T as MonthToken, _ as BnCalendarConfig, a as $BnEn, b as DateWithSeasonToken, c as BanglaDate, d as BanglaDateOptions, f as BanglaDayName, g as BanglaYear, h as BanglaSeasonName, i as $BnDatePadded, l as BanglaDateFormat, m as BanglaMonthName, n as $BanglaMonthDate, o as $BnMonthPadded, p as BanglaMonth, r as $BanglaYear, s as $BnYearPadded, t as $BanglaMonth, u as BanglaDateObject, v as BnCalendarVariant, w as MinuteToken, x as DayToken, y as DateToken } from "./types-CuBrWmN0.mjs";
|
|
18
18
|
export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, DateToken, DateWithSeasonToken, DayToken, HourToken, MSToken, MinuteToken, MonthToken, SecondToken, TimeToken, YearToken };
|
package/dist/utils.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
|
-
const
|
|
18
|
+
const require_dist = require('./dist-2u-Hm2TM.cjs');
|
|
19
19
|
|
|
20
|
-
exports.banglaToDigit =
|
|
21
|
-
exports.digitToBangla =
|
|
20
|
+
exports.banglaToDigit = require_dist.banglaToDigit;
|
|
21
|
+
exports.digitToBangla = require_dist.digitToBangla;
|
package/dist/utils.d.cts
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { r as BnDigitResult } from "./
|
|
17
|
+
import { r as BnDigitResult } from "./object-DyVg8BFt-DFzPgPEP.cjs";
|
|
18
18
|
|
|
19
|
-
//#region node_modules/.pnpm/
|
|
19
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/string-edtZyJHf.d.mts
|
|
20
|
+
//#region src/types/string.d.ts
|
|
20
21
|
declare global {
|
|
21
22
|
interface String {
|
|
22
23
|
toLowerCase(): string;
|
|
@@ -45,7 +46,7 @@ declare global {
|
|
|
45
46
|
}
|
|
46
47
|
/** - Options for generating anagrams. */
|
|
47
48
|
//#endregion
|
|
48
|
-
//#region node_modules/.pnpm/
|
|
49
|
+
//#region node_modules/.pnpm/toolbox-x@2.4.2/node_modules/toolbox-x/dist/index.d.mts
|
|
49
50
|
/**
|
|
50
51
|
* * Converts Bangla (Arabic system) digits to Latin (Arabic system) digits.
|
|
51
52
|
*
|
|
@@ -89,6 +90,14 @@ declare function banglaToDigit<Force extends boolean = true>(bnDigit: string, fo
|
|
|
89
90
|
* digitToBangla('12ab', false); // "১২"
|
|
90
91
|
* digitToBangla('12ab'); // "১২ab"
|
|
91
92
|
*/
|
|
92
|
-
declare function digitToBangla(digit: number | string, preserveNonDigit?: boolean): string;
|
|
93
|
+
declare function digitToBangla(digit: number | string, preserveNonDigit?: boolean): string; //#endregion
|
|
94
|
+
//#region src/number/utilities.d.ts
|
|
95
|
+
/**
|
|
96
|
+
* * Rounds a number to the nearest specified interval.
|
|
97
|
+
* @param value - The number to round.
|
|
98
|
+
* @param interval - The interval to round to. Defaults to `5`.
|
|
99
|
+
* @returns The number rounded to the nearest interval.
|
|
100
|
+
* @example roundToNearest(27, 5) → 25
|
|
101
|
+
*/
|
|
93
102
|
//#endregion
|
|
94
103
|
export { banglaToDigit, digitToBangla };
|