bn-calendar 1.2.2 → 1.2.4
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 +9 -9
- package/dist/dist-BSh0fQzq.mjs +255 -0
- package/dist/dist-BasKGWW6.cjs +303 -0
- package/dist/index.cjs +45 -21
- package/dist/index.d.cts +18 -2
- package/dist/index.d.mts +18 -2
- package/dist/index.mjs +26 -2
- package/dist/{types-dBV02J9_.d.mts → object-D70hzkoY-JjxsmDJd.d.cts} +97 -37
- package/dist/{types-CCT6pdoz.d.cts → object-D70hzkoY-JjxsmDJd.d.mts} +97 -37
- package/dist/{types-x2X_wAiB.d.cts → types-BKGg1Ls7.d.cts} +17 -1
- package/dist/{types-DuIqPJJ1.d.mts → types-CdJOp5Bk.d.mts} +17 -1
- package/dist/types.cjs +16 -0
- package/dist/types.d.cts +17 -1
- package/dist/types.d.mts +17 -1
- package/dist/types.mjs +16 -0
- package/dist/utils.cjs +19 -3
- package/dist/utils.d.cts +28 -4
- package/dist/utils.d.mts +28 -4
- package/dist/utils.mjs +17 -1
- package/package.json +8 -6
- package/dist/convert-BetQIRvF.cjs +0 -128
- package/dist/convert-CYpIfNZ_.mjs +0 -80
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
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
|
+
|
|
1
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
18
|
+
const require_dist = require('./dist-BasKGWW6.cjs');
|
|
3
19
|
|
|
4
|
-
//#region node_modules/.pnpm/
|
|
20
|
+
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/guards-DEcnNbI5.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
|
+
*/
|
|
5
29
|
function isLeapYear(year) {
|
|
6
|
-
const $year =
|
|
30
|
+
const $year = require_dist.normalizeNumber(year);
|
|
7
31
|
return $year ? $year % 4 === 0 && $year % 100 !== 0 || $year % 400 === 0 : false;
|
|
8
32
|
}
|
|
9
33
|
|
|
@@ -392,17 +416,17 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
392
416
|
/** * Creates a `BanglaCalendar` instance based on given parameter(s) */
|
|
393
417
|
constructor(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config) {
|
|
394
418
|
this.variant = this.#processVariants(dateBnYrOrCfg, bnMonthOrCfg, bnDateOrCfg, config);
|
|
395
|
-
let date = dateBnYrOrCfg instanceof Date ? dateBnYrOrCfg : 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());
|
|
396
420
|
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
397
421
|
const { year, month, monthDate } = this.#processDate(date);
|
|
398
|
-
let bnYear = BanglaCalendar.isBanglaYear(dateBnYrOrCfg) ?
|
|
399
|
-
let bnMonth = BanglaCalendar.isBanglaMonth(bnMonthOrCfg) ?
|
|
400
|
-
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;
|
|
401
425
|
if (BanglaCalendar.isBanglaDateString(dateBnYrOrCfg)) {
|
|
402
426
|
const parts = dateBnYrOrCfg.replace(/['"]/g, "").split("-");
|
|
403
|
-
bnYear =
|
|
404
|
-
bnMonth =
|
|
405
|
-
bnDate =
|
|
427
|
+
bnYear = require_dist.banglaToDigit(parts[0]);
|
|
428
|
+
bnMonth = require_dist.banglaToDigit(parts[1]);
|
|
429
|
+
bnDate = require_dist.banglaToDigit(parts[2]);
|
|
406
430
|
}
|
|
407
431
|
const { gregYear } = this.#processGregYear(bnYear, bnMonth);
|
|
408
432
|
const { bnMonthTable } = this.#getBnMonthTableLeap(gregYear, bnYear);
|
|
@@ -415,15 +439,15 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
415
439
|
} else bnMonth += 1;
|
|
416
440
|
}
|
|
417
441
|
this.year = {
|
|
418
|
-
bn:
|
|
442
|
+
bn: require_dist.digitToBangla(bnYear),
|
|
419
443
|
en: bnYear
|
|
420
444
|
};
|
|
421
445
|
this.month = {
|
|
422
|
-
bn:
|
|
446
|
+
bn: require_dist.digitToBangla(bnMonth),
|
|
423
447
|
en: bnMonth
|
|
424
448
|
};
|
|
425
449
|
this.date = {
|
|
426
|
-
bn:
|
|
450
|
+
bn: require_dist.digitToBangla(bnDate),
|
|
427
451
|
en: bnDate
|
|
428
452
|
};
|
|
429
453
|
const { gy, gm, gd, wd } = _extractDateUnits(this.toDate());
|
|
@@ -978,7 +1002,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
978
1002
|
* @returns `true` if the value contains a valid {@link variant} property, `false` otherwise
|
|
979
1003
|
*/
|
|
980
1004
|
$hasVariantConfig(value) {
|
|
981
|
-
return
|
|
1005
|
+
return require_dist.isObjectWithKeys(value, ["variant"]) && require_dist.isNonEmptyString(value.variant) && (value.variant === "revised-1966" || value.variant === "revised-2019");
|
|
982
1006
|
}
|
|
983
1007
|
/**
|
|
984
1008
|
* @static Checks whether a value is a valid Bangla year in Bangla digits (`০–৯৯৯৯`).
|
|
@@ -993,7 +1017,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
993
1017
|
* BanglaCalendar.isBanglaYear('1430'); // false (Latin digits)
|
|
994
1018
|
*/
|
|
995
1019
|
static isBanglaYear(value) {
|
|
996
|
-
return
|
|
1020
|
+
return require_dist.isNonEmptyString(value) && /^(?:০{0,3}[১-৯][০-৯]{0,3}|০)$/.test(value.trim());
|
|
997
1021
|
}
|
|
998
1022
|
/**
|
|
999
1023
|
* @static Checks whether a value is a valid Bangla year in Latin digits (`0–9999`).
|
|
@@ -1008,7 +1032,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1008
1032
|
* BanglaCalendar.isBanglaYearEn(-1); // false
|
|
1009
1033
|
*/
|
|
1010
1034
|
static isBanglaYearEn(value) {
|
|
1011
|
-
return
|
|
1035
|
+
return require_dist.isInteger(value) && value >= 0 && value <= 9999;
|
|
1012
1036
|
}
|
|
1013
1037
|
/**
|
|
1014
1038
|
* @static Checks whether a value is a valid Bangla month in Bangla digits (`১–১২`).
|
|
@@ -1023,7 +1047,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1023
1047
|
* BanglaCalendar.isBanglaMonth('0'); // false (Latin digit)
|
|
1024
1048
|
*/
|
|
1025
1049
|
static isBanglaMonth(value) {
|
|
1026
|
-
return
|
|
1050
|
+
return require_dist.isNonEmptyString(value) && /^(?:০?[১-৯]|১০|১১|১২)$/.test(value.trim());
|
|
1027
1051
|
}
|
|
1028
1052
|
/**
|
|
1029
1053
|
* @static Checks whether a value is a valid Bangla month in Latin digits (`1–12`).
|
|
@@ -1038,7 +1062,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1038
1062
|
* BanglaCalendar.isBanglaMonthEn(13); // false
|
|
1039
1063
|
*/
|
|
1040
1064
|
static isBanglaMonthEn(value) {
|
|
1041
|
-
return
|
|
1065
|
+
return require_dist.isInteger(value) && value >= 1 && value <= 12;
|
|
1042
1066
|
}
|
|
1043
1067
|
/**
|
|
1044
1068
|
* @static Checks whether a value is a valid Bangla date of month in Bangla digits (`১–৩১`).
|
|
@@ -1053,7 +1077,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1053
1077
|
* BanglaCalendar.isBanglaDate('০'); // false
|
|
1054
1078
|
*/
|
|
1055
1079
|
static isBanglaDate(value) {
|
|
1056
|
-
return
|
|
1080
|
+
return require_dist.isNonEmptyString(value) && /^(?:০?[১-৯]|[১২][০-৯]|৩০|৩১)$/.test(value.trim());
|
|
1057
1081
|
}
|
|
1058
1082
|
/**
|
|
1059
1083
|
* @static Checks whether a value is a valid Bangla date of month in Latin digits (`1–31`).
|
|
@@ -1068,7 +1092,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1068
1092
|
* BanglaCalendar.isBanglaDateEn(0); // false
|
|
1069
1093
|
*/
|
|
1070
1094
|
static isBanglaDateEn(value) {
|
|
1071
|
-
return
|
|
1095
|
+
return require_dist.isInteger(value) && value >= 1 && value <= 31;
|
|
1072
1096
|
}
|
|
1073
1097
|
/**
|
|
1074
1098
|
* @static Checks whether a string follows the Bangla date format pattern (`YYYY-MM-DD` with Bangla digits).
|
|
@@ -1088,7 +1112,7 @@ var BanglaCalendar = class BanglaCalendar {
|
|
|
1088
1112
|
* - Year must be `০-৯৯৯৯`, month must be `১-১২`, date must be `১-৩১`
|
|
1089
1113
|
*/
|
|
1090
1114
|
static isBanglaDateString(value) {
|
|
1091
|
-
if (
|
|
1115
|
+
if (require_dist.isNonEmptyString(value) && value.includes("-")) {
|
|
1092
1116
|
const [year, month, date] = value.replace(/['"]/g, "").split("-");
|
|
1093
1117
|
return BanglaCalendar.isBanglaYear(year) && BanglaCalendar.isBanglaMonth(month) && BanglaCalendar.isBanglaDate(date);
|
|
1094
1118
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { a as Enumerate, s as NumberRange } from "./object-D70hzkoY-JjxsmDJd.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-BKGg1Ls7.cjs";
|
|
3
19
|
|
|
4
20
|
//#region src/BanglaCalendar.d.ts
|
|
5
21
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { a as Enumerate, s as NumberRange } from "./object-D70hzkoY-JjxsmDJd.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-CdJOp5Bk.mjs";
|
|
3
19
|
|
|
4
20
|
//#region src/BanglaCalendar.d.ts
|
|
5
21
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
|
|
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 { 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-BSh0fQzq.mjs";
|
|
2
18
|
|
|
3
|
-
//#region node_modules/.pnpm/
|
|
19
|
+
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/guards-DEcnNbI5.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
|
+
*/
|
|
4
28
|
function isLeapYear(year) {
|
|
5
29
|
const $year = normalizeNumber(year);
|
|
6
30
|
return $year ? $year % 4 === 0 && $year % 100 !== 0 || $year % 400 === 0 : false;
|
|
@@ -1,4 +1,56 @@
|
|
|
1
|
-
|
|
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
|
+
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/object-D70hzkoY.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
|
+
*/
|
|
2
54
|
/**
|
|
3
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.
|
|
4
56
|
*
|
|
@@ -25,8 +77,19 @@
|
|
|
25
77
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
26
78
|
*/
|
|
27
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
|
+
*/
|
|
28
90
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
29
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`. */
|
|
30
93
|
/**
|
|
31
94
|
* Recursively join the string S for each element in the tuple A.
|
|
32
95
|
* Returns an empty string for an empty tuple.
|
|
@@ -45,41 +108,23 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
45
108
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
46
109
|
*/
|
|
47
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
|
+
*/
|
|
48
126
|
//#endregion
|
|
49
|
-
//#region
|
|
50
|
-
/** Year in either 4 or 2 digits format */
|
|
51
|
-
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
52
|
-
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
53
|
-
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
54
|
-
/** Day in either 2 letters or full word format */
|
|
55
|
-
type DayToken = (typeof DAY_FORMATS)[number];
|
|
56
|
-
/** Date in either 1 or 2 digits format */
|
|
57
|
-
type DateToken = (typeof DATE_FORMATS)[number];
|
|
58
|
-
/** Standard date formats. */
|
|
59
|
-
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'>}`;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/date/constants.d.ts
|
|
62
|
-
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
63
|
-
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
64
|
-
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
65
|
-
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/constants.d.ts
|
|
68
|
-
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
69
|
-
declare const BN_DIGITS: Readonly<{
|
|
70
|
-
readonly '\u09E6': 0;
|
|
71
|
-
readonly '\u09E7': 1;
|
|
72
|
-
readonly '\u09E8': 2;
|
|
73
|
-
readonly '\u09E9': 3;
|
|
74
|
-
readonly '\u09EA': 4;
|
|
75
|
-
readonly '\u09EB': 5;
|
|
76
|
-
readonly '\u09EC': 6;
|
|
77
|
-
readonly '\u09ED': 7;
|
|
78
|
-
readonly '\u09EE': 8;
|
|
79
|
-
readonly '\u09EF': 9;
|
|
80
|
-
}>;
|
|
81
|
-
//#endregion
|
|
82
|
-
//#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
|
|
83
128
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
84
129
|
type $EnumerateInternal<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : $EnumerateInternal<N, [...Acc, Acc['length']]>;
|
|
85
130
|
/**
|
|
@@ -112,11 +157,26 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
112
157
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
113
158
|
*/
|
|
114
159
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
+
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
115
161
|
/** Bangla digits from `০-৯` */
|
|
116
162
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
117
163
|
/** Bangla digits from `১-৯` */
|
|
118
164
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
119
165
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
120
|
-
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 */
|
|
121
181
|
//#endregion
|
|
122
|
-
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 };
|
|
@@ -1,4 +1,56 @@
|
|
|
1
|
-
|
|
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
|
+
//#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/object-D70hzkoY.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
|
+
*/
|
|
2
54
|
/**
|
|
3
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.
|
|
4
56
|
*
|
|
@@ -25,8 +77,19 @@
|
|
|
25
77
|
* @note Technically, this uses intersection with primitive base types (`string & {}` or `number & {}`) to retain IntelliSense while avoiding type narrowing.
|
|
26
78
|
*/
|
|
27
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
|
+
*/
|
|
28
90
|
/** * Build a tuple of given length (helper for type-level arithmetic). */
|
|
29
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`. */
|
|
30
93
|
/**
|
|
31
94
|
* Recursively join the string S for each element in the tuple A.
|
|
32
95
|
* Returns an empty string for an empty tuple.
|
|
@@ -45,41 +108,23 @@ type $JoinRepeat<S extends string, A extends unknown[]> = A extends [unknown, ..
|
|
|
45
108
|
* - If `S` is a union (e.g. 'a' | 'b'), the resulting union grows exponentially with `N`.
|
|
46
109
|
*/
|
|
47
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
|
+
*/
|
|
48
126
|
//#endregion
|
|
49
|
-
//#region
|
|
50
|
-
/** Year in either 4 or 2 digits format */
|
|
51
|
-
type YearToken = (typeof YEAR_FORMATS)[number];
|
|
52
|
-
/** Month in either 1 or 2 digits or 3 letters or full word format */
|
|
53
|
-
type MonthToken = (typeof MONTH_FORMATS)[number];
|
|
54
|
-
/** Day in either 2 letters or full word format */
|
|
55
|
-
type DayToken = (typeof DAY_FORMATS)[number];
|
|
56
|
-
/** Date in either 1 or 2 digits format */
|
|
57
|
-
type DateToken = (typeof DATE_FORMATS)[number];
|
|
58
|
-
/** Standard date formats. */
|
|
59
|
-
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'>}`;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/date/constants.d.ts
|
|
62
|
-
declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
63
|
-
declare const MONTH_FORMATS: readonly ["M", "MM", "mmm", "mmmm"];
|
|
64
|
-
declare const DATE_FORMATS: readonly ["DD", "D", "Do"];
|
|
65
|
-
declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/number/constants.d.ts
|
|
68
|
-
/** * Bangla digits from `০-৯` mapped against `0-9` */
|
|
69
|
-
declare const BN_DIGITS: Readonly<{
|
|
70
|
-
readonly '\u09E6': 0;
|
|
71
|
-
readonly '\u09E7': 1;
|
|
72
|
-
readonly '\u09E8': 2;
|
|
73
|
-
readonly '\u09E9': 3;
|
|
74
|
-
readonly '\u09EA': 4;
|
|
75
|
-
readonly '\u09EB': 5;
|
|
76
|
-
readonly '\u09EC': 6;
|
|
77
|
-
readonly '\u09ED': 7;
|
|
78
|
-
readonly '\u09EE': 8;
|
|
79
|
-
readonly '\u09EF': 9;
|
|
80
|
-
}>;
|
|
81
|
-
//#endregion
|
|
82
|
-
//#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
|
|
83
128
|
/** Enumerate & Enumerate Internal: builds a union of all numbers from 0 to N - 1 */
|
|
84
129
|
type $EnumerateInternal<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : $EnumerateInternal<N, [...Acc, Acc['length']]>;
|
|
85
130
|
/**
|
|
@@ -112,11 +157,26 @@ type $AddOne<N extends number, Acc extends unknown[] = []> = Acc['length'] exten
|
|
|
112
157
|
* @returns A union of numeric literal types from `From` to `To - 1`.
|
|
113
158
|
*/
|
|
114
159
|
type NumberRange<From extends number, To extends number> = Exclude<Enumerate<$AddOne<To>>, Enumerate<From>>;
|
|
160
|
+
/** - Number value in percentage `(0% - 100%)` without `%` symbol. */
|
|
115
161
|
/** Bangla digits from `০-৯` */
|
|
116
162
|
type BanglaDigit = keyof typeof BN_DIGITS;
|
|
117
163
|
/** Bangla digits from `১-৯` */
|
|
118
164
|
type $BnOnes = Exclude<BanglaDigit, '০'>;
|
|
119
165
|
/** Result type for Bangla digit conversion based on `force` flag */
|
|
120
|
-
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 */
|
|
121
181
|
//#endregion
|
|
122
|
-
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 };
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 Repeat, i as DateFormatToken, n as BanglaDigit, o as LooseLiteral, s as NumberRange, t as $BnOnes } from "./object-D70hzkoY-JjxsmDJd.cjs";
|
|
2
18
|
|
|
3
19
|
//#region src/constants.d.ts
|
|
4
20
|
/** Bangla month days table for different variants */
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 Repeat, i as DateFormatToken, n as BanglaDigit, o as LooseLiteral, s as NumberRange, t as $BnOnes } from "./object-D70hzkoY-JjxsmDJd.mjs";
|
|
2
18
|
|
|
3
19
|
//#region src/constants.d.ts
|
|
4
20
|
/** Bangla month days table for different variants */
|
package/dist/types.cjs
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
|