bn-calendar 1.2.3 → 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 +1 -1
- package/dist/dist-BSh0fQzq.mjs +255 -0
- package/dist/dist-BasKGWW6.cjs +303 -0
- package/dist/index.cjs +29 -21
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +10 -2
- package/dist/{types-DNIQWvTX.d.mts → object-D70hzkoY-JjxsmDJd.d.cts} +81 -37
- package/dist/{types-D3WdI9_e.d.cts → object-D70hzkoY-JjxsmDJd.d.mts} +81 -37
- package/dist/{types-L7OC1yyG.d.cts → types-BKGg1Ls7.d.cts} +1 -1
- package/dist/{types-B8dz3JYA.d.mts → types-CdJOp5Bk.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 +12 -4
- package/dist/utils.d.mts +12 -4
- package/dist/utils.mjs +1 -1
- package/package.json +8 -6
- package/dist/convert-B3CETM-p.mjs +0 -96
- package/dist/convert-CuE2E2-u.cjs +0 -144
package/dist/utils.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bn-calendar",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Comprehensive Bengali calendar system library built for any JavaScript and TypeScript environment.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"nhb",
|
|
14
14
|
"nazmul-nhb",
|
|
15
15
|
"nhb-toolbox",
|
|
16
|
+
"toolbox-x",
|
|
17
|
+
"bongabdo",
|
|
16
18
|
"calendar",
|
|
17
19
|
"bangla",
|
|
18
20
|
"bengali",
|
|
@@ -74,12 +76,12 @@
|
|
|
74
76
|
},
|
|
75
77
|
"license": "Apache-2.0",
|
|
76
78
|
"devDependencies": {
|
|
77
|
-
"@biomejs/biome": "^2.4.
|
|
78
|
-
"@types/node": "^25.
|
|
79
|
+
"@biomejs/biome": "^2.4.15",
|
|
80
|
+
"@types/node": "^25.9.1",
|
|
79
81
|
"husky": "^9.1.7",
|
|
80
|
-
"lint-staged": "^17.0.
|
|
82
|
+
"lint-staged": "^17.0.5",
|
|
81
83
|
"nhb-scripts": "^1.9.2",
|
|
82
|
-
"
|
|
84
|
+
"toolbox-x": "1.0.1-rc.6",
|
|
83
85
|
"tsdown": "^0.22.0",
|
|
84
86
|
"typescript": "^6.0.3"
|
|
85
87
|
},
|
|
@@ -107,7 +109,7 @@
|
|
|
107
109
|
"./package.json": "./package.json"
|
|
108
110
|
},
|
|
109
111
|
"inlinedDependencies": {
|
|
110
|
-
"
|
|
112
|
+
"toolbox-x": "1.0.1-rc.6"
|
|
111
113
|
},
|
|
112
114
|
"scripts": {
|
|
113
115
|
"build": "tsdown",
|
|
@@ -1,96 +0,0 @@
|
|
|
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/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/primitives.js
|
|
18
|
-
function isNumber(value) {
|
|
19
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
20
|
-
}
|
|
21
|
-
function isString(value) {
|
|
22
|
-
return typeof value === "string";
|
|
23
|
-
}
|
|
24
|
-
function isInteger(value) {
|
|
25
|
-
return isNumber(value) && Number.isInteger(value);
|
|
26
|
-
}
|
|
27
|
-
function isNonEmptyString(value) {
|
|
28
|
-
return isString(value) && value?.length > 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/non-primitives.js
|
|
33
|
-
function isArray(value) {
|
|
34
|
-
return Array.isArray(value);
|
|
35
|
-
}
|
|
36
|
-
function isObject(value) {
|
|
37
|
-
return value !== null && typeof value === "object" && !isArray(value);
|
|
38
|
-
}
|
|
39
|
-
function isObjectWithKeys(value, keys) {
|
|
40
|
-
return isObject(value) && keys?.every((key) => key in value);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/specials.js
|
|
45
|
-
function isDateString(value) {
|
|
46
|
-
return isString(value) && !isNaN(Date.parse(value));
|
|
47
|
-
}
|
|
48
|
-
function isNumericString(value) {
|
|
49
|
-
return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/constants.js
|
|
54
|
-
const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
55
|
-
"০": 0,
|
|
56
|
-
"১": 1,
|
|
57
|
-
"২": 2,
|
|
58
|
-
"৩": 3,
|
|
59
|
-
"৪": 4,
|
|
60
|
-
"৫": 5,
|
|
61
|
-
"৬": 6,
|
|
62
|
-
"৭": 7,
|
|
63
|
-
"৮": 8,
|
|
64
|
-
"৯": 9
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/utilities.js
|
|
69
|
-
function normalizeNumber(num) {
|
|
70
|
-
return isNumber(num) ? num : isNumericString(num) ? Number(num) : void 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/convert.js
|
|
75
|
-
function banglaToDigit(bnDigit, forceNumber = true) {
|
|
76
|
-
if (!isNonEmptyString(bnDigit)) return forceNumber ? NaN : "";
|
|
77
|
-
const digitStr = bnDigit.replace(/[০১২৩৪৫৬৭৮৯]/g, (d) => String(BN_DIGITS[d]));
|
|
78
|
-
if (forceNumber) return Number(digitStr.split("").filter((dig) => !isNaN(Number(dig))).join(""));
|
|
79
|
-
return digitStr;
|
|
80
|
-
}
|
|
81
|
-
function digitToBangla(digit, preserveNonDigit = true) {
|
|
82
|
-
const banglaDigits = Object.keys(BN_DIGITS);
|
|
83
|
-
const _matchAndConvert = (value) => {
|
|
84
|
-
return value.replace(/\d/g, (dig) => banglaDigits[Number(dig)]);
|
|
85
|
-
};
|
|
86
|
-
if (isNumber(digit)) return _matchAndConvert(String(digit));
|
|
87
|
-
if (isNonEmptyString(digit)) {
|
|
88
|
-
const bnDigStr = _matchAndConvert(digit);
|
|
89
|
-
if (preserveNonDigit || isNumericString(digit)) return bnDigStr;
|
|
90
|
-
return bnDigStr.split("").filter((dig) => banglaDigits.includes(dig)).join("");
|
|
91
|
-
}
|
|
92
|
-
return "";
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
export { isObjectWithKeys as a, isNumber as c, isDateString as i, digitToBangla as n, isInteger as o, normalizeNumber as r, isNonEmptyString as s, banglaToDigit as t };
|
|
@@ -1,144 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/primitives.js
|
|
19
|
-
function isNumber(value) {
|
|
20
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
21
|
-
}
|
|
22
|
-
function isString(value) {
|
|
23
|
-
return typeof value === "string";
|
|
24
|
-
}
|
|
25
|
-
function isInteger(value) {
|
|
26
|
-
return isNumber(value) && Number.isInteger(value);
|
|
27
|
-
}
|
|
28
|
-
function isNonEmptyString(value) {
|
|
29
|
-
return isString(value) && value?.length > 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/non-primitives.js
|
|
34
|
-
function isArray(value) {
|
|
35
|
-
return Array.isArray(value);
|
|
36
|
-
}
|
|
37
|
-
function isObject(value) {
|
|
38
|
-
return value !== null && typeof value === "object" && !isArray(value);
|
|
39
|
-
}
|
|
40
|
-
function isObjectWithKeys(value, keys) {
|
|
41
|
-
return isObject(value) && keys?.every((key) => key in value);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/specials.js
|
|
46
|
-
function isDateString(value) {
|
|
47
|
-
return isString(value) && !isNaN(Date.parse(value));
|
|
48
|
-
}
|
|
49
|
-
function isNumericString(value) {
|
|
50
|
-
return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/constants.js
|
|
55
|
-
const BN_DIGITS = /* @__PURE__ */ Object.freeze({
|
|
56
|
-
"০": 0,
|
|
57
|
-
"১": 1,
|
|
58
|
-
"২": 2,
|
|
59
|
-
"৩": 3,
|
|
60
|
-
"৪": 4,
|
|
61
|
-
"৫": 5,
|
|
62
|
-
"৬": 6,
|
|
63
|
-
"৭": 7,
|
|
64
|
-
"৮": 8,
|
|
65
|
-
"৯": 9
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/utilities.js
|
|
70
|
-
function normalizeNumber(num) {
|
|
71
|
-
return isNumber(num) ? num : isNumericString(num) ? Number(num) : void 0;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/convert.js
|
|
76
|
-
function banglaToDigit(bnDigit, forceNumber = true) {
|
|
77
|
-
if (!isNonEmptyString(bnDigit)) return forceNumber ? NaN : "";
|
|
78
|
-
const digitStr = bnDigit.replace(/[০১২৩৪৫৬৭৮৯]/g, (d) => String(BN_DIGITS[d]));
|
|
79
|
-
if (forceNumber) return Number(digitStr.split("").filter((dig) => !isNaN(Number(dig))).join(""));
|
|
80
|
-
return digitStr;
|
|
81
|
-
}
|
|
82
|
-
function digitToBangla(digit, preserveNonDigit = true) {
|
|
83
|
-
const banglaDigits = Object.keys(BN_DIGITS);
|
|
84
|
-
const _matchAndConvert = (value) => {
|
|
85
|
-
return value.replace(/\d/g, (dig) => banglaDigits[Number(dig)]);
|
|
86
|
-
};
|
|
87
|
-
if (isNumber(digit)) return _matchAndConvert(String(digit));
|
|
88
|
-
if (isNonEmptyString(digit)) {
|
|
89
|
-
const bnDigStr = _matchAndConvert(digit);
|
|
90
|
-
if (preserveNonDigit || isNumericString(digit)) return bnDigStr;
|
|
91
|
-
return bnDigStr.split("").filter((dig) => banglaDigits.includes(dig)).join("");
|
|
92
|
-
}
|
|
93
|
-
return "";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
Object.defineProperty(exports, 'banglaToDigit', {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function () {
|
|
100
|
-
return banglaToDigit;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, 'digitToBangla', {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () {
|
|
106
|
-
return digitToBangla;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(exports, 'isDateString', {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function () {
|
|
112
|
-
return isDateString;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, 'isInteger', {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function () {
|
|
118
|
-
return isInteger;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
Object.defineProperty(exports, 'isNonEmptyString', {
|
|
122
|
-
enumerable: true,
|
|
123
|
-
get: function () {
|
|
124
|
-
return isNonEmptyString;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
Object.defineProperty(exports, 'isNumber', {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function () {
|
|
130
|
-
return isNumber;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(exports, 'isObjectWithKeys', {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function () {
|
|
136
|
-
return isObjectWithKeys;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(exports, 'normalizeNumber', {
|
|
140
|
-
enumerable: true,
|
|
141
|
-
get: function () {
|
|
142
|
-
return normalizeNumber;
|
|
143
|
-
}
|
|
144
|
-
});
|