@dxtmisha/functional-basic 1.2.8 → 1.2.10
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/ai-description.txt +12 -3
- package/ai-types.txt +326 -470
- package/dist/library.js +23 -20
- package/dist/src/functions/getKey.d.ts +1 -1
- package/dist/src/functions/isTab.d.ts +8 -0
- package/dist/src/library.d.ts +1 -0
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -4563,7 +4563,7 @@ function Zn(e) {
|
|
|
4563
4563
|
var Qn = (e) => {
|
|
4564
4564
|
if (e instanceof HTMLElement) {
|
|
4565
4565
|
let t = e.tagName.toLowerCase();
|
|
4566
|
-
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
|
|
4566
|
+
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true") && !(e != null && e.readOnly) && !(e != null && e.disabled);
|
|
4567
4567
|
}
|
|
4568
4568
|
return !1;
|
|
4569
4569
|
}, $n = (e, t) => e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "Enter" || e.keyCode === 13 || e.keyCode === 32 ? t === void 0 ? !Qn(e.target) : !t : !1;
|
|
@@ -4588,8 +4588,11 @@ function nr(e, t) {
|
|
|
4588
4588
|
return Array.isArray(e) ? e.every((e) => b(e, t)) : b(e, t);
|
|
4589
4589
|
}
|
|
4590
4590
|
//#endregion
|
|
4591
|
+
//#region src/functions/isTab.ts
|
|
4592
|
+
var rr = (e) => e.key === "Tab" || e.code === "Tab" || e.keyCode === 9;
|
|
4593
|
+
//#endregion
|
|
4591
4594
|
//#region src/functions/removeCommonPrefix.ts
|
|
4592
|
-
function
|
|
4595
|
+
function ir(e, t) {
|
|
4593
4596
|
if (e.startsWith(t)) return e.slice(t.length).trim();
|
|
4594
4597
|
let n = 0;
|
|
4595
4598
|
for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
|
|
@@ -4597,13 +4600,13 @@ function rr(e, t) {
|
|
|
4597
4600
|
}
|
|
4598
4601
|
//#endregion
|
|
4599
4602
|
//#region src/functions/replaceComponentName.ts
|
|
4600
|
-
var
|
|
4603
|
+
var ar = (e, t, n) => {
|
|
4601
4604
|
var r;
|
|
4602
4605
|
return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
|
|
4603
4606
|
};
|
|
4604
4607
|
//#endregion
|
|
4605
4608
|
//#region src/functions/uniqueArray.ts
|
|
4606
|
-
function
|
|
4609
|
+
function or(e) {
|
|
4607
4610
|
return [...new Set(e)];
|
|
4608
4611
|
}
|
|
4609
4612
|
//#endregion
|
|
@@ -4612,12 +4615,12 @@ function $(e, n, i = !0) {
|
|
|
4612
4615
|
let a = Z(e);
|
|
4613
4616
|
return t(e) && t(n) && r(n, (n, r) => {
|
|
4614
4617
|
let o = e == null ? void 0 : e[r];
|
|
4615
|
-
t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(
|
|
4618
|
+
t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(or([...o, ...n])) : a[r] = $(Array.isArray(o) ? { ...o } : o, n, i) : a[r] = t(n) ? Z(n) : n;
|
|
4616
4619
|
}), a;
|
|
4617
4620
|
}
|
|
4618
4621
|
//#endregion
|
|
4619
4622
|
//#region src/functions/replaceTemplate.ts
|
|
4620
|
-
function
|
|
4623
|
+
function sr(e, t) {
|
|
4621
4624
|
let n = e;
|
|
4622
4625
|
return r(t, (e, t) => {
|
|
4623
4626
|
n = n.replace(Lt(`[${t}]`), S(e));
|
|
@@ -4625,7 +4628,7 @@ function or(e, t) {
|
|
|
4625
4628
|
}
|
|
4626
4629
|
//#endregion
|
|
4627
4630
|
//#region src/functions/secondToTime.ts
|
|
4628
|
-
function
|
|
4631
|
+
function cr(e, t) {
|
|
4629
4632
|
let n = y(e);
|
|
4630
4633
|
if (n > 0) {
|
|
4631
4634
|
let e = String(Math.floor(n / 60)).padStart(2, "0"), r = String(n % 60).padStart(2, "0");
|
|
@@ -4635,7 +4638,7 @@ function sr(e, t) {
|
|
|
4635
4638
|
}
|
|
4636
4639
|
//#endregion
|
|
4637
4640
|
//#region src/functions/setValues.ts
|
|
4638
|
-
function
|
|
4641
|
+
function lr(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, notEmpty: o = !1 }) {
|
|
4639
4642
|
if (n) {
|
|
4640
4643
|
if (i(e)) {
|
|
4641
4644
|
let n = e.indexOf(t), i = [...e];
|
|
@@ -4647,7 +4650,7 @@ function cr(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, no
|
|
|
4647
4650
|
}
|
|
4648
4651
|
//#endregion
|
|
4649
4652
|
//#region src/functions/splice.ts
|
|
4650
|
-
function
|
|
4653
|
+
function ur(e, n, i) {
|
|
4651
4654
|
if (t(e) && t(n)) {
|
|
4652
4655
|
if (i) {
|
|
4653
4656
|
let a = {}, o = !1;
|
|
@@ -4661,34 +4664,34 @@ function lr(e, n, i) {
|
|
|
4661
4664
|
}
|
|
4662
4665
|
//#endregion
|
|
4663
4666
|
//#region src/functions/toCamelCaseFirst.ts
|
|
4664
|
-
function
|
|
4667
|
+
function dr(e) {
|
|
4665
4668
|
return it(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
|
|
4666
4669
|
}
|
|
4667
4670
|
//#endregion
|
|
4668
4671
|
//#region src/functions/toKebabCase.ts
|
|
4669
|
-
function
|
|
4672
|
+
function fr(e) {
|
|
4670
4673
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/^[A-Z]/, (e) => e.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[A-Z]/g, (e) => e.toLowerCase());
|
|
4671
4674
|
}
|
|
4672
4675
|
//#endregion
|
|
4673
4676
|
//#region src/functions/toNumberByMax.ts
|
|
4674
|
-
function
|
|
4677
|
+
function pr(e, t, n, r) {
|
|
4675
4678
|
let i = y(e), a = y(t);
|
|
4676
|
-
return t && a < i ? `${
|
|
4679
|
+
return t && a < i ? `${mr(a, n, r)}+` : mr(i, n, r);
|
|
4677
4680
|
}
|
|
4678
|
-
var
|
|
4681
|
+
var mr = (e, t, n) => t ? new R(n).number(e) : e;
|
|
4679
4682
|
//#endregion
|
|
4680
4683
|
//#region src/functions/toPercent.ts
|
|
4681
|
-
function
|
|
4684
|
+
function hr(e, t) {
|
|
4682
4685
|
return e === 0 ? t : 1 / e * t;
|
|
4683
4686
|
}
|
|
4684
4687
|
//#endregion
|
|
4685
4688
|
//#region src/functions/toPercentBy100.ts
|
|
4686
|
-
function
|
|
4687
|
-
return
|
|
4689
|
+
function gr(e, t) {
|
|
4690
|
+
return hr(e, t) * 100;
|
|
4688
4691
|
}
|
|
4689
4692
|
//#endregion
|
|
4690
4693
|
//#region src/functions/uint8ArrayToBase64.ts
|
|
4691
|
-
function
|
|
4694
|
+
function _r(e) {
|
|
4692
4695
|
let t = "";
|
|
4693
4696
|
for (let n of e) t += String.fromCharCode(n);
|
|
4694
4697
|
if (s()) return window.btoa(t);
|
|
@@ -4700,7 +4703,7 @@ function gr(e) {
|
|
|
4700
4703
|
}
|
|
4701
4704
|
//#endregion
|
|
4702
4705
|
//#region src/functions/writeClipboardData.ts
|
|
4703
|
-
async function
|
|
4706
|
+
async function vr(e) {
|
|
4704
4707
|
if (s()) try {
|
|
4705
4708
|
await navigator.clipboard.writeText(e);
|
|
4706
4709
|
} catch (n) {
|
|
@@ -4709,4 +4712,4 @@ async function _r(e) {
|
|
|
4709
4712
|
}
|
|
4710
4713
|
}
|
|
4711
4714
|
//#endregion
|
|
4712
|
-
export { P as Api, M as ApiCache, Ae as ApiDataReturn, je as ApiDefault, Pe as ApiError, Me as ApiErrorItem, Ne as ApiErrorStorage, Fe as ApiHeaders, Le as ApiHydration, He as ApiInstance, N as ApiMethodItem, Re as ApiPreparation, Ve as ApiResponse, Oe as ApiStatus, Ue as BroadcastMessage, Ke as Cache, Ge as CacheItem, qe as CacheStatic, tt as Cookie, Qe as CookieBlock, Ze as CookieBlockInstance, I as CookieStorage, D as DataStorage, rt as Datetime, T as ErrorCenter, le as ErrorCenterHandler, ue as ErrorCenterInstance, Ce as EventItem, at as Formatters, H as FormattersType, ot as GEO_FLAG_ICON_NAME, O as Geo, st as GeoFlag, ye as GeoInstance, R as GeoIntl, ct as GeoPhone, lt as Global, dt as Hash, ut as HashInstance, mt as Icons, j as Loading, Te as LoadingInstance, Dt as Meta, G as MetaManager, Tt as MetaOg, St as MetaOpenGraphAge, bt as MetaOpenGraphAvailability, xt as MetaOpenGraphCondition, Ct as MetaOpenGraphGender, q as MetaOpenGraphTag, yt as MetaOpenGraphType, vt as MetaRobots, Ot as MetaStatic, K as MetaTag, Et as MetaTwitter, wt as MetaTwitterCard, J as MetaTwitterTag, kt as ResumableTimer, At as ScrollbarWidth, Ht as SearchList, Ft as SearchListData, It as SearchListItem, Bt as SearchListMatcher, Vt as SearchListOptions, E as ServerStorage, Wt as StorageCallback, Yt as TRANSLATE_GLOBAL_PREFIX, Xt as TRANSLATE_TIME_OUT, $t as Translate, Zt as TranslateFile, Qt as TranslateInstance, Pt as addTagHighlightMatch, F as anyToString, qt as applyTemplate, en as arrFill, on as blobToBase64, sn as capitalize, Z as copyObject, cn as copyObjectLite, U as createElement, ln as domQuerySelector, un as domQuerySelectorAll, W as encodeAttribute, ae as encodeLiteAttribute, mn as ensureMaxSize, Y as escapeExp, hn as eventStopPropagation, S as executeFunction, ze as executePromise, r as forEach, gn as frame, _n as getArrayHighlightMatch, vn as getAttributes, yn as getClipboardData, nt as getColumn, bn as getCurrentDate, xn as getCurrentTime, k as getElement, Cn as getElementId, dn as getElementImage, ht as getElementItem, xe as getElementOrWindow, fe as getElementSafeScript, Rt as getExactSearchExp, Lt as getExp, Tn as getFirst, pe as getHydrationData, V as getItemByPath, En as getKey, Dn as getLengthOfAllArray, On as getMaxLengthAllArray, kn as getMinLengthAllArray, Mn as getMouseClient, An as getMouseClientX, jn as getMouseClientY, Nn as getObjectByKeys, Pn as getObjectNoUndefined, Fn as getObjectOrNone, In as getOnlyText, Rn as getRandomText, o as getRequestString, zt as getSearchExp, jt as getSeparatingSearchExp, zn as getStepPercent, Bn as getStepValue, Hn as goScroll, Un as goScrollSmooth, Wn as goScrollTo, Kn as handleShare, qn as inArray, wn as initGetElementId, Jn as initScrollbarOffset, Yn as intersectKey, Jt as isApiSuccess, i as isArray, Xn as isDifferent, oe as isDomData, s as isDomRuntime, Zn as isElementVisible, $n as isEnter, l as isFilled, er as isFloat, x as isFunction, Se as isInDom, Qn as isInput, tr as isIntegerBetween, c as isNull, p as isNumber, t as isObject, n as isObjectNotArray, u as isOnLine, b as isSelected, nr as isSelectedByList, Gn as isShare, d as isString, be as isWindow, f as random,
|
|
4715
|
+
export { P as Api, M as ApiCache, Ae as ApiDataReturn, je as ApiDefault, Pe as ApiError, Me as ApiErrorItem, Ne as ApiErrorStorage, Fe as ApiHeaders, Le as ApiHydration, He as ApiInstance, N as ApiMethodItem, Re as ApiPreparation, Ve as ApiResponse, Oe as ApiStatus, Ue as BroadcastMessage, Ke as Cache, Ge as CacheItem, qe as CacheStatic, tt as Cookie, Qe as CookieBlock, Ze as CookieBlockInstance, I as CookieStorage, D as DataStorage, rt as Datetime, T as ErrorCenter, le as ErrorCenterHandler, ue as ErrorCenterInstance, Ce as EventItem, at as Formatters, H as FormattersType, ot as GEO_FLAG_ICON_NAME, O as Geo, st as GeoFlag, ye as GeoInstance, R as GeoIntl, ct as GeoPhone, lt as Global, dt as Hash, ut as HashInstance, mt as Icons, j as Loading, Te as LoadingInstance, Dt as Meta, G as MetaManager, Tt as MetaOg, St as MetaOpenGraphAge, bt as MetaOpenGraphAvailability, xt as MetaOpenGraphCondition, Ct as MetaOpenGraphGender, q as MetaOpenGraphTag, yt as MetaOpenGraphType, vt as MetaRobots, Ot as MetaStatic, K as MetaTag, Et as MetaTwitter, wt as MetaTwitterCard, J as MetaTwitterTag, kt as ResumableTimer, At as ScrollbarWidth, Ht as SearchList, Ft as SearchListData, It as SearchListItem, Bt as SearchListMatcher, Vt as SearchListOptions, E as ServerStorage, Wt as StorageCallback, Yt as TRANSLATE_GLOBAL_PREFIX, Xt as TRANSLATE_TIME_OUT, $t as Translate, Zt as TranslateFile, Qt as TranslateInstance, Pt as addTagHighlightMatch, F as anyToString, qt as applyTemplate, en as arrFill, on as blobToBase64, sn as capitalize, Z as copyObject, cn as copyObjectLite, U as createElement, ln as domQuerySelector, un as domQuerySelectorAll, W as encodeAttribute, ae as encodeLiteAttribute, mn as ensureMaxSize, Y as escapeExp, hn as eventStopPropagation, S as executeFunction, ze as executePromise, r as forEach, gn as frame, _n as getArrayHighlightMatch, vn as getAttributes, yn as getClipboardData, nt as getColumn, bn as getCurrentDate, xn as getCurrentTime, k as getElement, Cn as getElementId, dn as getElementImage, ht as getElementItem, xe as getElementOrWindow, fe as getElementSafeScript, Rt as getExactSearchExp, Lt as getExp, Tn as getFirst, pe as getHydrationData, V as getItemByPath, En as getKey, Dn as getLengthOfAllArray, On as getMaxLengthAllArray, kn as getMinLengthAllArray, Mn as getMouseClient, An as getMouseClientX, jn as getMouseClientY, Nn as getObjectByKeys, Pn as getObjectNoUndefined, Fn as getObjectOrNone, In as getOnlyText, Rn as getRandomText, o as getRequestString, zt as getSearchExp, jt as getSeparatingSearchExp, zn as getStepPercent, Bn as getStepValue, Hn as goScroll, Un as goScrollSmooth, Wn as goScrollTo, Kn as handleShare, qn as inArray, wn as initGetElementId, Jn as initScrollbarOffset, Yn as intersectKey, Jt as isApiSuccess, i as isArray, Xn as isDifferent, oe as isDomData, s as isDomRuntime, Zn as isElementVisible, $n as isEnter, l as isFilled, er as isFloat, x as isFunction, Se as isInDom, Qn as isInput, tr as isIntegerBetween, c as isNull, p as isNumber, t as isObject, n as isObjectNotArray, u as isOnLine, b as isSelected, nr as isSelectedByList, Gn as isShare, d as isString, rr as isTab, be as isWindow, f as random, ir as removeCommonPrefix, ar as replaceComponentName, $ as replaceRecursive, sr as replaceTemplate, pn as resizeImageByMax, cr as secondToTime, gt as setElementItem, lr as setValues, ee as sleep, ur as splice, Ln as strFill, Je as strSplit, A as toArray, it as toCamelCase, dr as toCamelCaseFirst, L as toDate, fr as toKebabCase, y as toNumber, pr as toNumberByMax, hr as toPercent, gr as toPercentBy100, a as toString, Ye as transformation, _r as uint8ArrayToBase64, or as uniqueArray, vr as writeClipboardData };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the pressed key is Tab.
|
|
3
|
+
*
|
|
4
|
+
* Проверяет, является ли нажатая клавиша Tab.
|
|
5
|
+
* @param event - event object / объект события
|
|
6
|
+
* @returns true if tab pressed / true, если нажат tab
|
|
7
|
+
*/
|
|
8
|
+
export declare const isTab: (event: KeyboardEvent) => boolean;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ export * from './functions/isSelected';
|
|
|
137
137
|
export * from './functions/isSelectedByList';
|
|
138
138
|
export * from './functions/isShare';
|
|
139
139
|
export * from './functions/isString';
|
|
140
|
+
export * from './functions/isTab';
|
|
140
141
|
export * from './functions/isWindow';
|
|
141
142
|
export * from './functions/random';
|
|
142
143
|
export * from './functions/removeCommonPrefix';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/functional-basic",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Foundational utility library for modern web development — HTTP client, geolocation, i18n, SEO meta tags, caching, storage, DOM utilities, and more. Framework-agnostic, zero dependencies, TypeScript-first.",
|
|
7
7
|
"keywords": [
|