@dxtmisha/functional-basic 1.8.4 → 1.8.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/dist/library.js CHANGED
@@ -160,7 +160,7 @@ function oe(e, t, n) {
160
160
  return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
161
161
  }
162
162
  //#endregion
163
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/typeof.js
163
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/typeof.js
164
164
  function C(e) {
165
165
  "@babel/helpers - typeof";
166
166
  return C = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -170,7 +170,7 @@ function C(e) {
170
170
  }, C(e);
171
171
  }
172
172
  //#endregion
173
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPrimitive.js
173
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPrimitive.js
174
174
  function se(e, t) {
175
175
  if (C(e) != "object" || !e) return e;
176
176
  var n = e[Symbol.toPrimitive];
@@ -182,13 +182,13 @@ function se(e, t) {
182
182
  return (t === "string" ? String : Number)(e);
183
183
  }
184
184
  //#endregion
185
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPropertyKey.js
185
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPropertyKey.js
186
186
  function ce(e) {
187
187
  var t = se(e, "string");
188
188
  return C(t) == "symbol" ? t : t + "";
189
189
  }
190
190
  //#endregion
191
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/defineProperty.js
191
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/defineProperty.js
192
192
  function w(e, t, n) {
193
193
  return (t = ce(t)) in e ? Object.defineProperty(e, t, {
194
194
  value: n,
@@ -671,7 +671,7 @@ var ve = "ui-storage", ye = () => D.get("__ui:data-storage__", () => ({})), O =
671
671
  }
672
672
  get() {
673
673
  var e;
674
- return (e = this.storage.get()) == null ? !1 : e;
674
+ return (e = this.storage.get()) != null && e;
675
675
  }
676
676
  set(e) {
677
677
  this.storage.set(e);
@@ -743,7 +743,7 @@ var ve = "ui-storage", ye = () => D.get("__ui:data-storage__", () => ({})), O =
743
743
  });
744
744
  }
745
745
  static toMaxAge(e, t) {
746
- return `Max-Age=${encodeURIComponent(e === "" ? -1 : t == null ? 10080 * 60 : t)}`;
746
+ return `Max-Age=${encodeURIComponent(e === "" ? -1 : t == null ? 604800 : t)}`;
747
747
  }
748
748
  static toSameSite(e) {
749
749
  return `SameSite=${encodeURIComponent(e == null ? "Strict" : e)}`;
@@ -1160,7 +1160,7 @@ var Me = class {
1160
1160
  static unregistrationEvent(e, t) {
1161
1161
  this.getItem().unregistrationEvent(e, t);
1162
1162
  }
1163
- }, Fe, Ie = 1440 * 60, P = class {
1163
+ }, Fe, Ie = 86400, P = class {
1164
1164
  static init(e, t, n, r) {
1165
1165
  this.getListener = e, this.setListener = t, this.removeListener = n, r && (this.cacheStepAgeClearOld = r, this.stepAgeClearOld = r);
1166
1166
  }
@@ -1204,7 +1204,7 @@ var Me = class {
1204
1204
  return s() && !n ? !1 : !!t;
1205
1205
  }
1206
1206
  static isAge(e) {
1207
- return e ? e.age ? e.age * 1e3 + e.cacheAge >= Date.now() : !0 : !1;
1207
+ return e ? !e.age || e.age * 1e3 + e.cacheAge >= Date.now() : !1;
1208
1208
  }
1209
1209
  static isItem(e) {
1210
1210
  return e in this.getList();
@@ -2086,9 +2086,7 @@ var z = class e {
2086
2086
  case "lsf":
2087
2087
  l = `${e}${c ? ` ${c}` : ""} ${s}`;
2088
2088
  break;
2089
- default:
2090
- l = `${s} ${e}`;
2091
- break;
2089
+ default: l = `${s} ${e}`;
2092
2090
  }
2093
2091
  return l;
2094
2092
  }
@@ -2109,8 +2107,8 @@ var z = class e {
2109
2107
  if (n) {
2110
2108
  let t = this.numberObject(r);
2111
2109
  return t ? nt(t.formatToParts(b(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
2112
- } else if ("currency" in r) return this.number(typeof e == "number" ? e : i, r);
2113
- else return this.number(typeof e == "number" ? e : i, {
2110
+ }
2111
+ return "currency" in r ? this.number(typeof e == "number" ? e : i, r) : this.number(typeof e == "number" ? e : i, {
2114
2112
  ...r,
2115
2113
  style: "decimal"
2116
2114
  });
@@ -2173,9 +2171,7 @@ var z = class e {
2173
2171
  case "many":
2174
2172
  t = (o == null ? void 0 : o[3]) || (o == null ? void 0 : o[2]) || (o == null ? void 0 : o[1]);
2175
2173
  break;
2176
- case "other":
2177
- t = o.length === 6 ? o[o.length - 2] : o[o.length - 1];
2178
- break;
2174
+ case "other": t = o.length === 6 ? o[o.length - 2] : o[o.length - 1];
2179
2175
  }
2180
2176
  return `${this.number(a, r)} ${(s = t) == null ? "" : s}`.trim();
2181
2177
  }
@@ -3350,7 +3346,7 @@ var W = {}, lt = {
3350
3346
  static is(e) {
3351
3347
  return e in this.icons || this.getName(e) in this.icons;
3352
3348
  }
3353
- static async get(e, t = "", n = 1e3 * 60 * 3) {
3349
+ static async get(e, t = "", n = 18e4) {
3354
3350
  let r = this.getRaw(e, t);
3355
3351
  return typeof r == "string" ? r === gt && n > 0 ? (await this.wait(), this.get(e, t, n - ht)) : r : p(r) ? await r() : await r;
3356
3352
  }
@@ -3822,7 +3818,7 @@ var q = class {
3822
3818
  }), e;
3823
3819
  }
3824
3820
  set(e) {
3825
- return e ? e instanceof URL ? this.url = new URL(e.href) : /^[a-z0-9+.-]+:/i.test(e) ? this.url = new URL(e) : s() ? this.url = new URL(e, window.location.origin) : this.url = new URL(e, "http://localhost") : s() ? this.url = new URL(window.location.href) : this.url = new URL("http://localhost"), this;
3821
+ return this.url = e ? e instanceof URL ? new URL(e.href) : /^[a-z0-9+.-]+:/i.test(e) ? new URL(e) : s() ? new URL(e, window.location.origin) : new URL(e, "http://localhost") : s() ? new URL(window.location.href) : new URL("http://localhost"), this;
3826
3822
  }
3827
3823
  setParam(e, t) {
3828
3824
  return this.url.searchParams.set(e, t), this;
@@ -4120,7 +4116,7 @@ var qt = class {
4120
4116
  this.initMatcher();
4121
4117
  }
4122
4118
  initMatcher() {
4123
- this.item.is() ? this.matcher = this.options.getFindExactMatch() ? Gt(this.item.get()) : Kt(this.item.get()) : this.matcher = void 0;
4119
+ this.matcher = this.item.is() ? this.options.getFindExactMatch() ? Gt(this.item.get()) : Kt(this.item.get()) : void 0;
4124
4120
  }
4125
4121
  }, Jt = class {
4126
4122
  constructor(e) {
@@ -4135,7 +4131,7 @@ var qt = class {
4135
4131
  }
4136
4132
  getReturnEverything() {
4137
4133
  var e;
4138
- return (e = this.getOptions().returnEverything) == null ? !1 : e;
4134
+ return (e = this.getOptions().returnEverything) != null && e;
4139
4135
  }
4140
4136
  getDelay() {
4141
4137
  var e;
@@ -4143,7 +4139,7 @@ var qt = class {
4143
4139
  }
4144
4140
  getFindExactMatch() {
4145
4141
  var e;
4146
- return (e = this.getOptions().findExactMatch) == null ? !1 : e;
4142
+ return (e = this.getOptions().findExactMatch) != null && e;
4147
4143
  }
4148
4144
  getClassName() {
4149
4145
  var e;
@@ -4274,7 +4270,7 @@ var qt = class {
4274
4270
  })), r;
4275
4271
  }, tn = (e) => {
4276
4272
  var t;
4277
- return i(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && /^2/.test(String(e.statusObject.status)) || !("status" in e) && !("success" in e) && !("statusObject" in e) && /^2/.test(String(L.getStatus().getStatus()))));
4273
+ return i(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || e != null && (t = e.statusObject) != null && t.status && /^2/.test(String(e.statusObject.status)) || !("status" in e) && !("success" in e) && !("statusObject" in e) && /^2/.test(String(L.getStatus().getStatus()))));
4278
4274
  }, nn = "global", rn = 160, an = class {
4279
4275
  constructor(e, t = () => A.getLanguage(), n = () => A.getLocation()) {
4280
4276
  w(this, "language", void 0), w(this, "location", void 0), w(this, "files", {}), w(this, "data", {}), this.language = t, this.location = n, e && this.add(e);
@@ -4364,10 +4360,12 @@ var qt = class {
4364
4360
  });
4365
4361
  }
4366
4362
  async addNormalOrSync(e) {
4367
- if (l(e)) if (L.isLocalhost()) this.addSync(e);
4368
- else {
4369
- let t = Object.keys(e);
4370
- t.length > 0 && await this.add(t);
4363
+ if (l(e)) {
4364
+ if (L.isLocalhost()) this.addSync(e);
4365
+ else {
4366
+ let t = Object.keys(e);
4367
+ t.length > 0 && await this.add(t);
4368
+ }
4371
4369
  }
4372
4370
  }
4373
4371
  addSyncByLocation(e) {
@@ -4927,7 +4925,7 @@ var ur = (e) => {
4927
4925
  return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true") && !(e != null && e.readOnly) && !(e != null && e.disabled);
4928
4926
  }
4929
4927
  return !1;
4930
- }, dr = (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 ? !ur(e.target) : !t : !1;
4928
+ }, dr = (e, t) => e.code !== "Space" && e.code !== "Enter" && e.key !== " " && e.key !== "Spacebar" && e.key !== "Enter" && e.keyCode !== 13 && e.keyCode !== 32 ? !1 : t === void 0 ? !ur(e.target) : !t;
4931
4929
  //#endregion
4932
4930
  //#region src/functions/isFloat.ts
4933
4931
  function fr(e) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional-basic",
3
3
  "private": false,
4
- "version": "1.8.4",
4
+ "version": "1.8.6",
5
5
  "type": "module",
6
6
  "description": "Foundational isomorphic utility library for modern web and SSR development — HTTP client, state storage, i18n localization, SEO metadata, DOM events, formatting, and data utilities. Framework-agnostic, TypeScript-first.",
7
7
  "keywords": [
@@ -70,11 +70,11 @@
70
70
  "publish-to-npm": "npm publish --access public"
71
71
  },
72
72
  "files": [
73
- "ai-prompts",
73
+ "ai-resources",
74
74
  "dist",
75
75
  "ai-description.md",
76
76
  "ai-doc.md",
77
- "ai-mcp.json",
77
+ "ai-mcp-resources.json",
78
78
  "ai-types.md",
79
79
  "CHANGELOG.md",
80
80
  "LICENSE",
package/ai-mcp.json DELETED
@@ -1,26 +0,0 @@
1
- [
2
- {
3
- "uri": "@dxtmisha/functional-basic/ai-types.md",
4
- "name": "TypeScript Type Definitions",
5
- "mimeType": "text/markdown",
6
- "description": "Comprehensive TypeScript type definitions, enums, class interfaces, and utility function signatures for API request handling, internationalization, and client-side data management."
7
- },
8
- {
9
- "uri": "@dxtmisha/functional-basic/ai-description.md",
10
- "name": "Isomorphic Utility Toolkit",
11
- "mimeType": "text/markdown",
12
- "description": "Provides an architectural overview of the isomorphic runtime toolkit covering HTTP networking, state persistence, i18n, DOM helpers, and metadata management across browser and SSR environments. Details core utility capabilities and outlines mandatory cross-referencing rules for API references, types, and coding standards."
13
- },
14
- {
15
- "uri": "@dxtmisha/functional-basic/ai-prompts/api-reference.md",
16
- "name": "API Reference Guide",
17
- "mimeType": "text/markdown",
18
- "description": "API reference and code usage examples for @dxtmisha/functional-basic, detailing HTTP clients, caching, storage, geolocation, DOM events, and general utilities."
19
- },
20
- {
21
- "uri": "@dxtmisha/functional-basic/ai-prompts/coding-standards.md",
22
- "name": "Coding Standards",
23
- "mimeType": "text/markdown",
24
- "description": "Architectural conventions, class structure rules, SSR safety guidelines, and TypeScript typing standards for code implementation."
25
- }
26
- ]
@@ -1,6 +0,0 @@
1
- # Coding Standards & Conventions
2
-
3
- - **Class Structure**: Properties/Variables (`public`->`protected`->`private`) -> Constructor -> Public Methods -> Protected Methods -> Private Methods. Within each method group, follow order: 1) `get` / `set` (getters/setters), 2) `is...` / `has...`, 3) `get...` / `set...`, 4) `add...` / `remove...`, 5) `update...` / `reset...`, 6) remaining methods. Within each subgroup, methods are grouped semantically by logical pairs and rules (e.g., `min` / `max`, `width` / `height`, `x` / `y` / `z`), and remaining methods are sorted alphabetically.
4
- - **Style/Types**: `PascalCase` classes, `camelCase` methods/props, `UPPER_SNAKE_CASE` constants. No `any` (use `unknown`/generics). Explicit return types for ALL methods. Export all interfaces. Type files: `*Types.ts`. Use `@effect/schema` for schemas.
5
- - **SSR Safety**: Isomorphic code. Do NOT store request state in globals. Use `isDomRuntime()` before `window`/`document`. Use `ServerStorage.get('key', () => new Class())` for request-isolated singletons.
6
- - **Utility & Primitive Functions**: ALWAYS use primitive helper functions from this package (e.g. `isFunction`, `executeFunction`, `isFilled`, `isObject`, `isString`, `isArray`, etc.) instead of writing custom inline checks or conditions.
File without changes