@dxtmisha/functional-basic 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Checks if the current environment is a data URL.
3
+ *
4
+ * Проверяет, является ли текущая среда URL-адресом данных.
5
+ */
6
+ export declare function isDomData(): boolean;
package/dist/library.d.ts CHANGED
@@ -70,6 +70,7 @@ export * from './functions/initScrollbarOffset';
70
70
  export * from './functions/intersectKey';
71
71
  export * from './functions/isArray';
72
72
  export * from './functions/isDifferent';
73
+ export * from './functions/isDomData';
73
74
  export * from './functions/isDomRuntime';
74
75
  export * from './functions/isFilled';
75
76
  export * from './functions/isFloat';
package/dist/library.js CHANGED
@@ -174,8 +174,11 @@ class O {
174
174
  * Возвращает объект для работы с хранилищем.
175
175
  */
176
176
  getMethod() {
177
- if (l())
178
- return this.isSession ? window == null ? void 0 : window.sessionStorage : window == null ? void 0 : window.localStorage;
177
+ if (l()) {
178
+ const t = this.isSession ? window == null ? void 0 : window.sessionStorage : window == null ? void 0 : window.localStorage;
179
+ if (t)
180
+ return t;
181
+ }
179
182
  }
180
183
  /**
181
184
  * Getting the storage key name.
@@ -4684,7 +4687,10 @@ function Je(i, t) {
4684
4687
  s !== (t == null ? void 0 : t[n]) && (e = !0);
4685
4688
  }), e;
4686
4689
  }
4687
- function Qe(i) {
4690
+ function Qe() {
4691
+ return location.href.startsWith("data:");
4692
+ }
4693
+ function Xe(i) {
4688
4694
  switch (typeof i) {
4689
4695
  case "number":
4690
4696
  return !0;
@@ -4694,11 +4700,11 @@ function Qe(i) {
4694
4700
  return !1;
4695
4701
  }
4696
4702
  }
4697
- function Xe(i, t) {
4703
+ function Me(i, t) {
4698
4704
  const e = Math.floor(t);
4699
4705
  return i >= e && i < e + 1;
4700
4706
  }
4701
- function Me(i, t) {
4707
+ function _e(i, t) {
4702
4708
  return Array.isArray(i) ? i.every((e) => it(e, t)) : it(i, t);
4703
4709
  }
4704
4710
  function $e(i) {
@@ -4718,13 +4724,13 @@ function Z(i, t, e = !0) {
4718
4724
  }
4719
4725
  ), s;
4720
4726
  }
4721
- function _e(i, t) {
4727
+ function Oe(i, t) {
4722
4728
  let e = i;
4723
4729
  return g(t, (s, n) => {
4724
4730
  e = e.replace(de(`[${n}]`), E(s));
4725
4731
  }), e;
4726
4732
  }
4727
- function Oe(i) {
4733
+ function Te(i) {
4728
4734
  const t = k(i);
4729
4735
  if (t > 0) {
4730
4736
  const e = String(Math.floor(t / 60)).padStart(2, "0"), s = String(t % 60).padStart(2, "0");
@@ -4732,7 +4738,7 @@ function Oe(i) {
4732
4738
  }
4733
4739
  return "00:00";
4734
4740
  }
4735
- function Te(i, t, {
4741
+ function Ge(i, t, {
4736
4742
  multiple: e = !1,
4737
4743
  maxlength: s = 0,
4738
4744
  alwaysChange: n = !0,
@@ -4747,7 +4753,7 @@ function Te(i, t, {
4747
4753
  }
4748
4754
  return n || i !== t ? t : i;
4749
4755
  }
4750
- function Ge(i, t, e) {
4756
+ function ti(i, t, e) {
4751
4757
  if (m(i) && m(t)) {
4752
4758
  if (e) {
4753
4759
  let s = {}, n = !1;
@@ -4763,13 +4769,13 @@ function Ge(i, t, e) {
4763
4769
  function pe(i) {
4764
4770
  return i.toString().trim().replace(/[^\w- ]+/g, "").replace(/ +/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (t) => `${t.toLowerCase()}`).replace(/-+([a-zA-Z0-9])/g, (...t) => `${String(t[1]).toUpperCase()}`).replace(/^([A-Z])/, (t) => `${t.toLowerCase()}`);
4765
4771
  }
4766
- function ti(i) {
4772
+ function ei(i) {
4767
4773
  return pe(i).replace(/^([a-z])/, (t) => `${t.toUpperCase()}`);
4768
4774
  }
4769
- function ei(i) {
4775
+ function ii(i) {
4770
4776
  return i.toString().trim().replace(/[^\w- ]+/g, "").replace(/ +/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (t) => `${t.toLowerCase()}`).replace(/^[A-Z]/, (t) => t.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (t) => `-${t.toLowerCase()}`).replace(/[A-Z]/g, (t) => t.toLowerCase());
4771
4777
  }
4772
- function ii(i, t, e, s) {
4778
+ function si(i, t, e, s) {
4773
4779
  const n = k(i), o = k(t);
4774
4780
  return t && o < n ? `${Lt(o, e, s)}+` : Lt(n, e, s);
4775
4781
  }
@@ -4777,10 +4783,10 @@ const Lt = (i, t, e) => t ? new J(e).number(i) : i;
4777
4783
  function be(i, t) {
4778
4784
  return 1 / i * t;
4779
4785
  }
4780
- function si(i, t) {
4786
+ function ri(i, t) {
4781
4787
  return be(i, t) * 100;
4782
4788
  }
4783
- async function ri(i) {
4789
+ async function ni(i) {
4784
4790
  if (l())
4785
4791
  try {
4786
4792
  await navigator.clipboard.writeText(i);
@@ -4873,38 +4879,39 @@ export {
4873
4879
  qe as intersectKey,
4874
4880
  Bt as isArray,
4875
4881
  Je as isDifferent,
4882
+ Qe as isDomData,
4876
4883
  l as isDomRuntime,
4877
4884
  D as isFilled,
4878
- Qe as isFloat,
4885
+ Xe as isFloat,
4879
4886
  Ct as isFunction,
4880
4887
  Ut as isInDom,
4881
- Xe as isIntegerBetween,
4888
+ Me as isIntegerBetween,
4882
4889
  q as isNull,
4883
4890
  at as isNumber,
4884
4891
  m as isObject,
4885
4892
  C as isObjectNotArray,
4886
4893
  it as isSelected,
4887
- Me as isSelectedByList,
4894
+ _e as isSelectedByList,
4888
4895
  z as isString,
4889
4896
  At as isWindow,
4890
4897
  Y as random,
4891
4898
  Z as replaceRecursive,
4892
- _e as replaceTemplate,
4893
- Oe as secondToTime,
4899
+ Oe as replaceTemplate,
4900
+ Te as secondToTime,
4894
4901
  Ot as setElementItem,
4895
- Te as setValues,
4896
- Ge as splice,
4902
+ Ge as setValues,
4903
+ ti as splice,
4897
4904
  ye as strFill,
4898
4905
  H as toArray,
4899
4906
  pe as toCamelCase,
4900
- ti as toCamelCaseFirst,
4907
+ ei as toCamelCaseFirst,
4901
4908
  B as toDate,
4902
- ei as toKebabCase,
4909
+ ii as toKebabCase,
4903
4910
  k as toNumber,
4904
- ii as toNumberByMax,
4911
+ si as toNumberByMax,
4905
4912
  be as toPercent,
4906
- si as toPercentBy100,
4913
+ ri as toPercentBy100,
4907
4914
  Nt as transformation,
4908
4915
  $e as uniqueArray,
4909
- ri as writeClipboardData
4916
+ ni as writeClipboardData
4910
4917
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional-basic",
3
3
  "private": false,
4
- "version": "0.1.4",
4
+ "version": "0.2.0",
5
5
  "type": "module",
6
6
  "description": "Core functional utility library for modern web development without framework dependencies",
7
7
  "keywords": [