yummies 7.11.0 → 7.12.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.
Files changed (146) hide show
  1. package/async.cjs +162 -48
  2. package/async.cjs.map +1 -1
  3. package/async.d.ts +108 -7
  4. package/async.js +163 -54
  5. package/async.js.map +1 -1
  6. package/chunk-CVq3Gv4J.cjs +50 -0
  7. package/chunk-YKewjYmz.js +37 -0
  8. package/common.cjs +48 -8
  9. package/common.cjs.map +1 -1
  10. package/common.d.ts +35 -2
  11. package/common.js +49 -11
  12. package/common.js.map +1 -1
  13. package/complex.cjs +275 -128
  14. package/complex.cjs.map +1 -1
  15. package/complex.js +275 -133
  16. package/complex.js.map +1 -1
  17. package/cookie.cjs +17 -7
  18. package/cookie.cjs.map +1 -1
  19. package/cookie.d.ts +8 -0
  20. package/cookie.js +18 -9
  21. package/cookie.js.map +1 -1
  22. package/css.cjs +147 -39
  23. package/css.cjs.map +1 -1
  24. package/css.d.ts +98 -6
  25. package/css.js +143 -41
  26. package/css.js.map +1 -1
  27. package/data.cjs +90 -55
  28. package/data.cjs.map +1 -1
  29. package/data.d.ts +32 -0
  30. package/data.js +91 -61
  31. package/data.js.map +1 -1
  32. package/date-time.cjs +578 -412
  33. package/date-time.cjs.map +1 -1
  34. package/date-time.d.ts +88 -0
  35. package/date-time.js +575 -421
  36. package/date-time.js.map +1 -1
  37. package/device.cjs +48 -23
  38. package/device.cjs.map +1 -1
  39. package/device.d.ts +32 -0
  40. package/device.js +49 -31
  41. package/device.js.map +1 -1
  42. package/encodings.cjs +275 -266
  43. package/encodings.cjs.map +1 -1
  44. package/encodings.d.ts +8 -0
  45. package/encodings.js +276 -268
  46. package/encodings.js.map +1 -1
  47. package/errors.cjs +20 -18
  48. package/errors.cjs.map +1 -1
  49. package/errors.js +19 -19
  50. package/errors.js.map +1 -1
  51. package/file.cjs +42 -24
  52. package/file.cjs.map +1 -1
  53. package/file.d.ts +16 -0
  54. package/file.js +43 -27
  55. package/file.js.map +1 -1
  56. package/format.cjs +125 -83
  57. package/format.cjs.map +1 -1
  58. package/format.js +118 -82
  59. package/format.js.map +1 -1
  60. package/html.cjs +226 -137
  61. package/html.cjs.map +1 -1
  62. package/html.d.ts +64 -0
  63. package/html.js +223 -150
  64. package/html.js.map +1 -1
  65. package/id.cjs +74 -17
  66. package/id.cjs.map +1 -1
  67. package/id.js +73 -24
  68. package/id.js.map +1 -1
  69. package/imports.cjs +41 -29
  70. package/imports.cjs.map +1 -1
  71. package/imports.d.ts +8 -0
  72. package/imports.js +40 -31
  73. package/imports.js.map +1 -1
  74. package/math.cjs +32 -6
  75. package/math.cjs.map +1 -1
  76. package/math.d.ts +16 -0
  77. package/math.js +33 -10
  78. package/math.js.map +1 -1
  79. package/media.cjs +275 -84
  80. package/media.cjs.map +1 -1
  81. package/media.d.ts +188 -2
  82. package/media.js +274 -93
  83. package/media.js.map +1 -1
  84. package/mobx.cjs +353 -193
  85. package/mobx.cjs.map +1 -1
  86. package/mobx.d.ts +7 -0
  87. package/mobx.js +351 -200
  88. package/mobx.js.map +1 -1
  89. package/ms.cjs +21 -10
  90. package/ms.cjs.map +1 -1
  91. package/ms.js +22 -13
  92. package/ms.js.map +1 -1
  93. package/number.cjs +13 -7
  94. package/number.cjs.map +1 -1
  95. package/number.js +14 -9
  96. package/number.js.map +1 -1
  97. package/package.json +10 -2
  98. package/parser.cjs +117 -64
  99. package/parser.cjs.map +1 -1
  100. package/parser.js +111 -64
  101. package/parser.js.map +1 -1
  102. package/price.cjs +24 -18
  103. package/price.cjs.map +1 -1
  104. package/price.d.ts +8 -0
  105. package/price.js +25 -20
  106. package/price.js.map +1 -1
  107. package/random.cjs +79 -13
  108. package/random.cjs.map +1 -1
  109. package/random.d.ts +64 -0
  110. package/random.js +80 -22
  111. package/random.js.map +1 -1
  112. package/react.cjs +673 -214
  113. package/react.cjs.map +1 -1
  114. package/react.d.ts +21 -0
  115. package/react.js +674 -239
  116. package/react.js.map +1 -1
  117. package/sound.cjs +14 -9
  118. package/sound.cjs.map +1 -1
  119. package/sound.js +15 -11
  120. package/sound.js.map +1 -1
  121. package/storage.cjs +49 -50
  122. package/storage.cjs.map +1 -1
  123. package/storage.d.ts +8 -0
  124. package/storage.js +50 -53
  125. package/storage.js.map +1 -1
  126. package/text.cjs +51 -34
  127. package/text.cjs.map +1 -1
  128. package/text.js +52 -37
  129. package/text.js.map +1 -1
  130. package/type-guard.cjs +292 -72
  131. package/type-guard.cjs.map +1 -1
  132. package/type-guard.js +288 -73
  133. package/type-guard.js.map +1 -1
  134. package/types.cjs +0 -2
  135. package/types.global.cjs +0 -2
  136. package/types.global.js +0 -2
  137. package/types.js +0 -2
  138. package/vibrate.cjs +31 -6
  139. package/vibrate.cjs.map +1 -1
  140. package/vibrate.d.ts +23 -1
  141. package/vibrate.js +32 -8
  142. package/vibrate.js.map +1 -1
  143. package/types.cjs.map +0 -1
  144. package/types.global.cjs.map +0 -1
  145. package/types.global.js.map +0 -1
  146. package/types.js.map +0 -1
@@ -0,0 +1,50 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ //#endregion
33
+ Object.defineProperty(exports, "__commonJSMin", {
34
+ enumerable: true,
35
+ get: function() {
36
+ return __commonJSMin;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "__exportAll", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return __exportAll;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "__toESM", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return __toESM;
49
+ }
50
+ });
@@ -0,0 +1,37 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
33
+ if (typeof require !== "undefined") return require.apply(this, arguments);
34
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
35
+ });
36
+ //#endregion
37
+ export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
package/common.cjs CHANGED
@@ -1,12 +1,52 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const callFunction = (fn, ...args) => {
4
- if (typeof fn === "function") {
5
- return fn(...args);
6
- }
7
- return fn;
2
+ //#region src/common.ts
3
+ /**
4
+ * Normalizes a {@link MaybeFn} — a value that may be either a plain `TValue` or a function
5
+ * `(...args: TArgs) => TValue`. If `fn` is callable, it is invoked with `args` and the return
6
+ * value is returned; otherwise `fn` is returned as-is (treated as the resolved value).
7
+ *
8
+ * Typical uses: config fields that accept a static value or a lazy/computed factory, theme
9
+ * tokens, labels, or callbacks where the caller should not branch on `typeof fn` themselves.
10
+ *
11
+ * @template TValue - Result type when `fn` is not a function, or return type when it is.
12
+ * @template TArgs - Tuple of argument types passed through when `fn` is invoked.
13
+ *
14
+ * @param fn - Either a `TValue` or a function producing `TValue` from `args`.
15
+ * @param args - Arguments forwarded to `fn` only when `fn` is a function.
16
+ * @returns The resolved `TValue`.
17
+ *
18
+ * @example
19
+ * Plain value — returned unchanged (no call):
20
+ * ```ts
21
+ * const n = callFunction(42); // 42
22
+ * const label = callFunction('Hello'); // 'Hello'
23
+ * ```
24
+ *
25
+ * @example
26
+ * Function — called with the given arguments:
27
+ * ```ts
28
+ * const sum = callFunction((a: number, b: number) => a + b, 2, 3); // 5
29
+ * ```
30
+ *
31
+ * @example
32
+ * Same API for “static or factory” props:
33
+ * ```ts
34
+ * type Title = MaybeFn<string, [locale: string]>;
35
+ * const title: Title = (loc) => (loc === 'ru' ? 'Привет' : 'Hi');
36
+ * const text = callFunction(title, 'ru'); // 'Привет'
37
+ * const fixed = callFunction('Hi', 'ru'); // 'Hi' — args ignored
38
+ * ```
39
+ */
40
+ var callFunction = (fn, ...args) => {
41
+ if (typeof fn === "function") return fn(...args);
42
+ return fn;
8
43
  };
9
- const resolveFnValue = callFunction;
44
+ /**
45
+ * @deprecated use {callFunction}
46
+ */
47
+ var resolveFnValue = callFunction;
48
+ //#endregion
10
49
  exports.callFunction = callFunction;
11
50
  exports.resolveFnValue = resolveFnValue;
12
- //# sourceMappingURL=common.cjs.map
51
+
52
+ //# sourceMappingURL=common.cjs.map
package/common.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs","sources":["../src/common.ts"],"sourcesContent":["import type { MaybeFn } from 'yummies/types';\n\n/**\n * @deprecated use {MaybeFn} type\n */\nexport type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;\n\n/**\n * Calls the provided function with the given arguments if it is a function;\n * otherwise, returns the value directly.\n */\nexport const callFunction = <TValue, TArgs extends any[] = []>(\n fn: MaybeFn<TValue, TArgs>,\n ...args: TArgs\n) => {\n if (typeof fn === 'function') {\n return (fn as any)(...args) as TValue;\n }\n\n return fn;\n};\n\n/**\n * @deprecated use {callFunction}\n */\nexport const resolveFnValue = callFunction;\n"],"names":[],"mappings":";;AAWO,MAAM,eAAe,CAC1B,OACG,SACA;AACH,MAAI,OAAO,OAAO,YAAY;AAC5B,WAAQ,GAAW,GAAG,IAAI;AAAA,EAC5B;AAEA,SAAO;AACT;AAKO,MAAM,iBAAiB;;;"}
1
+ {"version":3,"file":"common.cjs","names":[],"sources":["../src/common.ts"],"sourcesContent":["import type { MaybeFn } from 'yummies/types';\n\n/**\n * @deprecated use {MaybeFn} type\n */\nexport type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;\n\n/**\n * Normalizes a {@link MaybeFn} — a value that may be either a plain `TValue` or a function\n * `(...args: TArgs) => TValue`. If `fn` is callable, it is invoked with `args` and the return\n * value is returned; otherwise `fn` is returned as-is (treated as the resolved value).\n *\n * Typical uses: config fields that accept a static value or a lazy/computed factory, theme\n * tokens, labels, or callbacks where the caller should not branch on `typeof fn` themselves.\n *\n * @template TValue - Result type when `fn` is not a function, or return type when it is.\n * @template TArgs - Tuple of argument types passed through when `fn` is invoked.\n *\n * @param fn - Either a `TValue` or a function producing `TValue` from `args`.\n * @param args - Arguments forwarded to `fn` only when `fn` is a function.\n * @returns The resolved `TValue`.\n *\n * @example\n * Plain value — returned unchanged (no call):\n * ```ts\n * const n = callFunction(42); // 42\n * const label = callFunction('Hello'); // 'Hello'\n * ```\n *\n * @example\n * Function — called with the given arguments:\n * ```ts\n * const sum = callFunction((a: number, b: number) => a + b, 2, 3); // 5\n * ```\n *\n * @example\n * Same API for “static or factory” props:\n * ```ts\n * type Title = MaybeFn<string, [locale: string]>;\n * const title: Title = (loc) => (loc === 'ru' ? 'Привет' : 'Hi');\n * const text = callFunction(title, 'ru'); // 'Привет'\n * const fixed = callFunction('Hi', 'ru'); // 'Hi' — args ignored\n * ```\n */\nexport const callFunction = <TValue, TArgs extends any[] = []>(\n fn: MaybeFn<TValue, TArgs>,\n ...args: TArgs\n) => {\n if (typeof fn === 'function') {\n return (fn as any)(...args) as TValue;\n }\n\n return fn;\n};\n\n/**\n * @deprecated use {callFunction}\n */\nexport const resolveFnValue = callFunction;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,gBACX,IACA,GAAG,SACA;AACH,KAAI,OAAO,OAAO,WAChB,QAAQ,GAAW,GAAG,KAAK;AAG7B,QAAO;;;;;AAMT,IAAa,iBAAiB"}
package/common.d.ts CHANGED
@@ -5,8 +5,41 @@ import { MaybeFn } from 'yummies/types';
5
5
  */
6
6
  type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;
7
7
  /**
8
- * Calls the provided function with the given arguments if it is a function;
9
- * otherwise, returns the value directly.
8
+ * Normalizes a {@link MaybeFn} a value that may be either a plain `TValue` or a function
9
+ * `(...args: TArgs) => TValue`. If `fn` is callable, it is invoked with `args` and the return
10
+ * value is returned; otherwise `fn` is returned as-is (treated as the resolved value).
11
+ *
12
+ * Typical uses: config fields that accept a static value or a lazy/computed factory, theme
13
+ * tokens, labels, or callbacks where the caller should not branch on `typeof fn` themselves.
14
+ *
15
+ * @template TValue - Result type when `fn` is not a function, or return type when it is.
16
+ * @template TArgs - Tuple of argument types passed through when `fn` is invoked.
17
+ *
18
+ * @param fn - Either a `TValue` or a function producing `TValue` from `args`.
19
+ * @param args - Arguments forwarded to `fn` only when `fn` is a function.
20
+ * @returns The resolved `TValue`.
21
+ *
22
+ * @example
23
+ * Plain value — returned unchanged (no call):
24
+ * ```ts
25
+ * const n = callFunction(42); // 42
26
+ * const label = callFunction('Hello'); // 'Hello'
27
+ * ```
28
+ *
29
+ * @example
30
+ * Function — called with the given arguments:
31
+ * ```ts
32
+ * const sum = callFunction((a: number, b: number) => a + b, 2, 3); // 5
33
+ * ```
34
+ *
35
+ * @example
36
+ * Same API for “static or factory” props:
37
+ * ```ts
38
+ * type Title = MaybeFn<string, [locale: string]>;
39
+ * const title: Title = (loc) => (loc === 'ru' ? 'Привет' : 'Hi');
40
+ * const text = callFunction(title, 'ru'); // 'Привет'
41
+ * const fixed = callFunction('Hi', 'ru'); // 'Hi' — args ignored
42
+ * ```
10
43
  */
11
44
  declare const callFunction: <TValue, TArgs extends any[] = []>(fn: MaybeFn<TValue, TArgs>, ...args: TArgs) => TValue;
12
45
  /**
package/common.js CHANGED
@@ -1,12 +1,50 @@
1
- const callFunction = (fn, ...args) => {
2
- if (typeof fn === "function") {
3
- return fn(...args);
4
- }
5
- return fn;
1
+ //#region src/common.ts
2
+ /**
3
+ * Normalizes a {@link MaybeFn} — a value that may be either a plain `TValue` or a function
4
+ * `(...args: TArgs) => TValue`. If `fn` is callable, it is invoked with `args` and the return
5
+ * value is returned; otherwise `fn` is returned as-is (treated as the resolved value).
6
+ *
7
+ * Typical uses: config fields that accept a static value or a lazy/computed factory, theme
8
+ * tokens, labels, or callbacks where the caller should not branch on `typeof fn` themselves.
9
+ *
10
+ * @template TValue - Result type when `fn` is not a function, or return type when it is.
11
+ * @template TArgs - Tuple of argument types passed through when `fn` is invoked.
12
+ *
13
+ * @param fn - Either a `TValue` or a function producing `TValue` from `args`.
14
+ * @param args - Arguments forwarded to `fn` only when `fn` is a function.
15
+ * @returns The resolved `TValue`.
16
+ *
17
+ * @example
18
+ * Plain value — returned unchanged (no call):
19
+ * ```ts
20
+ * const n = callFunction(42); // 42
21
+ * const label = callFunction('Hello'); // 'Hello'
22
+ * ```
23
+ *
24
+ * @example
25
+ * Function — called with the given arguments:
26
+ * ```ts
27
+ * const sum = callFunction((a: number, b: number) => a + b, 2, 3); // 5
28
+ * ```
29
+ *
30
+ * @example
31
+ * Same API for “static or factory” props:
32
+ * ```ts
33
+ * type Title = MaybeFn<string, [locale: string]>;
34
+ * const title: Title = (loc) => (loc === 'ru' ? 'Привет' : 'Hi');
35
+ * const text = callFunction(title, 'ru'); // 'Привет'
36
+ * const fixed = callFunction('Hi', 'ru'); // 'Hi' — args ignored
37
+ * ```
38
+ */
39
+ var callFunction = (fn, ...args) => {
40
+ if (typeof fn === "function") return fn(...args);
41
+ return fn;
6
42
  };
7
- const resolveFnValue = callFunction;
8
- export {
9
- callFunction,
10
- resolveFnValue
11
- };
12
- //# sourceMappingURL=common.js.map
43
+ /**
44
+ * @deprecated use {callFunction}
45
+ */
46
+ var resolveFnValue = callFunction;
47
+ //#endregion
48
+ export { callFunction, resolveFnValue };
49
+
50
+ //# sourceMappingURL=common.js.map
package/common.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../src/common.ts"],"sourcesContent":["import type { MaybeFn } from 'yummies/types';\n\n/**\n * @deprecated use {MaybeFn} type\n */\nexport type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;\n\n/**\n * Calls the provided function with the given arguments if it is a function;\n * otherwise, returns the value directly.\n */\nexport const callFunction = <TValue, TArgs extends any[] = []>(\n fn: MaybeFn<TValue, TArgs>,\n ...args: TArgs\n) => {\n if (typeof fn === 'function') {\n return (fn as any)(...args) as TValue;\n }\n\n return fn;\n};\n\n/**\n * @deprecated use {callFunction}\n */\nexport const resolveFnValue = callFunction;\n"],"names":[],"mappings":"AAWO,MAAM,eAAe,CAC1B,OACG,SACA;AACH,MAAI,OAAO,OAAO,YAAY;AAC5B,WAAQ,GAAW,GAAG,IAAI;AAAA,EAC5B;AAEA,SAAO;AACT;AAKO,MAAM,iBAAiB;"}
1
+ {"version":3,"file":"common.js","names":[],"sources":["../src/common.ts"],"sourcesContent":["import type { MaybeFn } from 'yummies/types';\n\n/**\n * @deprecated use {MaybeFn} type\n */\nexport type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;\n\n/**\n * Normalizes a {@link MaybeFn} — a value that may be either a plain `TValue` or a function\n * `(...args: TArgs) => TValue`. If `fn` is callable, it is invoked with `args` and the return\n * value is returned; otherwise `fn` is returned as-is (treated as the resolved value).\n *\n * Typical uses: config fields that accept a static value or a lazy/computed factory, theme\n * tokens, labels, or callbacks where the caller should not branch on `typeof fn` themselves.\n *\n * @template TValue - Result type when `fn` is not a function, or return type when it is.\n * @template TArgs - Tuple of argument types passed through when `fn` is invoked.\n *\n * @param fn - Either a `TValue` or a function producing `TValue` from `args`.\n * @param args - Arguments forwarded to `fn` only when `fn` is a function.\n * @returns The resolved `TValue`.\n *\n * @example\n * Plain value — returned unchanged (no call):\n * ```ts\n * const n = callFunction(42); // 42\n * const label = callFunction('Hello'); // 'Hello'\n * ```\n *\n * @example\n * Function — called with the given arguments:\n * ```ts\n * const sum = callFunction((a: number, b: number) => a + b, 2, 3); // 5\n * ```\n *\n * @example\n * Same API for “static or factory” props:\n * ```ts\n * type Title = MaybeFn<string, [locale: string]>;\n * const title: Title = (loc) => (loc === 'ru' ? 'Привет' : 'Hi');\n * const text = callFunction(title, 'ru'); // 'Привет'\n * const fixed = callFunction('Hi', 'ru'); // 'Hi' — args ignored\n * ```\n */\nexport const callFunction = <TValue, TArgs extends any[] = []>(\n fn: MaybeFn<TValue, TArgs>,\n ...args: TArgs\n) => {\n if (typeof fn === 'function') {\n return (fn as any)(...args) as TValue;\n }\n\n return fn;\n};\n\n/**\n * @deprecated use {callFunction}\n */\nexport const resolveFnValue = callFunction;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,gBACX,IACA,GAAG,SACA;AACH,KAAI,OAAO,OAAO,WAChB,QAAQ,GAAW,GAAG,KAAK;AAG7B,QAAO;;;;;AAMT,IAAa,iBAAiB"}