@dxtmisha/functional-basic 1.2.0 → 1.2.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.2.3] - 2026-05-16
6
+
7
+ ### Added
8
+ - **Api**: Enhanced `setHeaders` method to support dynamic header resolution via a callback function, allowing for reactive or contextual header updates.
9
+
10
+ ## [1.2.2] - 2026-05-16
11
+
12
+ ### Changed / Improved
13
+ - **Cookie**: Refined `getInstance` static method with explicit return type and type casting for better TypeScript compatibility.
14
+ - **Api**: Improved formatting of `ApiDataItem` type definition for better readability.
15
+ - **Maintenance**: Updated package versioning and synchronized with the new monorepo build and publish orchestration system.
16
+
5
17
  ## [1.2.0] - 2026-05-14
6
18
 
7
19
  ### Added
package/dist/library.js CHANGED
@@ -151,7 +151,7 @@ function se() {
151
151
  return s() && location.href.startsWith("data:");
152
152
  }
153
153
  //#endregion
154
- //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
154
+ //#region \0@oxc-project+runtime@0.130.0/helpers/typeof.js
155
155
  function S(e) {
156
156
  "@babel/helpers - typeof";
157
157
  return S = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -161,7 +161,7 @@ function S(e) {
161
161
  }, S(e);
162
162
  }
163
163
  //#endregion
164
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
164
+ //#region \0@oxc-project+runtime@0.130.0/helpers/toPrimitive.js
165
165
  function ce(e, t) {
166
166
  if (S(e) != "object" || !e) return e;
167
167
  var n = e[Symbol.toPrimitive];
@@ -173,13 +173,13 @@ function ce(e, t) {
173
173
  return (t === "string" ? String : Number)(e);
174
174
  }
175
175
  //#endregion
176
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
176
+ //#region \0@oxc-project+runtime@0.130.0/helpers/toPropertyKey.js
177
177
  function le(e) {
178
178
  var t = ce(e, "string");
179
179
  return S(t) == "symbol" ? t : t + "";
180
180
  }
181
181
  //#endregion
182
- //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
182
+ //#region \0@oxc-project+runtime@0.130.0/helpers/defineProperty.js
183
183
  function C(e, t, n) {
184
184
  return (t = le(t)) in e ? Object.defineProperty(e, t, {
185
185
  value: n,
@@ -1158,7 +1158,8 @@ var Oe = class {
1158
1158
  return e instanceof FormData ? this.get(t, null) : this.get(t, n);
1159
1159
  }
1160
1160
  set(e) {
1161
- return n(e) && (this.headers = e), this;
1161
+ let t = x(e);
1162
+ return n(t) && (this.headers = t), this;
1162
1163
  }
1163
1164
  }, Ne = "__ui:api:hydration:id__", Pe = class {
1164
1165
  constructor() {
@@ -93,7 +93,7 @@ export declare class Api {
93
93
  * @param headers default headers / заголовки по умолчанию
94
94
  * @returns void / ничего не возвращает
95
95
  */
96
- static setHeaders(headers: Record<string, string>): void;
96
+ static setHeaders(headers: Record<string, string> | (() => Record<string, string>)): void;
97
97
  /**
98
98
  * Modifies the default request data.
99
99
  *
@@ -33,5 +33,5 @@ export declare class ApiHeaders {
33
33
  * @param headers list of default headers/ список заголовков по умолчанию
34
34
  * @returns this instance for chaining / текущий экземпляр для цепочки вызовов
35
35
  */
36
- set(headers: Record<string, string>): this;
36
+ set(headers: Record<string, string> | (() => Record<string, string>)): this;
37
37
  }
@@ -134,7 +134,7 @@ export declare class ApiInstance {
134
134
  * Изменяет данные заголовка по умолчанию.
135
135
  * @param headers default headers / заголовки по умолчанию
136
136
  */
137
- setHeaders(headers: Record<string, string>): this;
137
+ setHeaders(headers: Record<string, string> | (() => Record<string, string>)): this;
138
138
  /**
139
139
  * Modifies the default request data.
140
140
  *
@@ -12,7 +12,7 @@ export declare class Cookie<T> {
12
12
  * Возвращает экземпляр класса по указанному имени cookie.
13
13
  * @param name cookie name/ название cookie
14
14
  */
15
- static getInstance<T>(name: string): Cookie<unknown>;
15
+ static getInstance<T>(name: string): Cookie<T>;
16
16
  /** Cookie value / Значение cookie */
17
17
  private value?;
18
18
  /** Cookie options / Параметры cookie */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional-basic",
3
3
  "private": false,
4
- "version": "1.2.0",
4
+ "version": "1.2.3",
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": [