mhz-helpers 1.2.16 → 1.2.18

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 (2) hide show
  1. package/dist/index.js +137 -89
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -2349,18 +2349,18 @@ var ir = class {
2349
2349
  #e;
2350
2350
  #t;
2351
2351
  #n;
2352
- #r;
2353
2352
  #s;
2353
+ #r;
2354
2354
  #o;
2355
2355
  #a;
2356
2356
  constructor(t) {
2357
- super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#r = t.client, this.#n = this.#r.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = un(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
2357
+ super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#s = t.client, this.#n = this.#s.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = un(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
2358
2358
  }
2359
2359
  get meta() {
2360
2360
  return this.options.meta;
2361
2361
  }
2362
2362
  get promise() {
2363
- return this.#s?.promise;
2363
+ return this.#r?.promise;
2364
2364
  }
2365
2365
  setOptions(t) {
2366
2366
  if (this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
@@ -2387,8 +2387,8 @@ var ir = class {
2387
2387
  this.#i({ type: "setState", state: t, setStateOptions: e });
2388
2388
  }
2389
2389
  cancel(t) {
2390
- const e = this.#s?.promise;
2391
- return this.#s?.cancel(t), e ? e.then(B).catch(B) : Promise.resolve();
2390
+ const e = this.#r?.promise;
2391
+ return this.#r?.cancel(t), e ? e.then(B).catch(B) : Promise.resolve();
2392
2392
  }
2393
2393
  destroy() {
2394
2394
  super.destroy(), this.cancel({ silent: !0 });
@@ -2418,16 +2418,16 @@ var ir = class {
2418
2418
  return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !tr(this.state.dataUpdatedAt, t);
2419
2419
  }
2420
2420
  onFocus() {
2421
- this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#s?.continue();
2421
+ this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
2422
2422
  }
2423
2423
  onOnline() {
2424
- this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#s?.continue();
2424
+ this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
2425
2425
  }
2426
2426
  addObserver(t) {
2427
2427
  this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.#n.notify({ type: "observerAdded", query: this, observer: t }));
2428
2428
  }
2429
2429
  removeObserver(t) {
2430
- this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (this.#s && (this.#a ? this.#s.cancel({ revert: !0 }) : this.#s.cancelRetry()), this.scheduleGc()), this.#n.notify({ type: "observerRemoved", query: this, observer: t }));
2430
+ this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (this.#r && (this.#a ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#n.notify({ type: "observerRemoved", query: this, observer: t }));
2431
2431
  }
2432
2432
  getObserversCount() {
2433
2433
  return this.observers.length;
@@ -2439,11 +2439,11 @@ var ir = class {
2439
2439
  if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
2440
2440
  // re-start the fetch; there is a chance that the query is still in a
2441
2441
  // pending state when that happens
2442
- this.#s?.status() !== "rejected") {
2442
+ this.#r?.status() !== "rejected") {
2443
2443
  if (this.state.data !== void 0 && e?.cancelRefetch)
2444
2444
  this.cancel({ silent: !0 });
2445
- else if (this.#s)
2446
- return this.#s.continueRetry(), this.#s.promise;
2445
+ else if (this.#r)
2446
+ return this.#r.continueRetry(), this.#r.promise;
2447
2447
  }
2448
2448
  if (t && this.setOptions(t), !this.options.queryFn) {
2449
2449
  const a = this.observers.find((u) => u.options.queryFn);
@@ -2460,7 +2460,7 @@ var ir = class {
2460
2460
  }, s = () => {
2461
2461
  const a = nr(this.options, e), l = (() => {
2462
2462
  const c = {
2463
- client: this.#r,
2463
+ client: this.#s,
2464
2464
  queryKey: this.queryKey,
2465
2465
  meta: this.meta
2466
2466
  };
@@ -2476,13 +2476,13 @@ var ir = class {
2476
2476
  fetchOptions: e,
2477
2477
  options: this.options,
2478
2478
  queryKey: this.queryKey,
2479
- client: this.#r,
2479
+ client: this.#s,
2480
2480
  state: this.state,
2481
2481
  fetchFn: s
2482
2482
  };
2483
2483
  return r(a), a;
2484
2484
  })();
2485
- this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#s = sr({
2485
+ this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = sr({
2486
2486
  initialPromise: e?.initialPromise,
2487
2487
  fn: o.fetchFn,
2488
2488
  onCancel: (a) => {
@@ -2506,7 +2506,7 @@ var ir = class {
2506
2506
  canRun: () => !0
2507
2507
  });
2508
2508
  try {
2509
- const a = await this.#s.start();
2509
+ const a = await this.#r.start();
2510
2510
  if (a === void 0)
2511
2511
  throw process.env.NODE_ENV !== "production" && console.error(
2512
2512
  `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
@@ -2519,7 +2519,7 @@ var ir = class {
2519
2519
  } catch (a) {
2520
2520
  if (a instanceof mt) {
2521
2521
  if (a.silent)
2522
- return this.#s.promise;
2522
+ return this.#r.promise;
2523
2523
  if (a.revert) {
2524
2524
  if (this.state.data === void 0)
2525
2525
  throw a;
@@ -2648,8 +2648,8 @@ var Si = class extends we {
2648
2648
  #e;
2649
2649
  #t = void 0;
2650
2650
  #n = void 0;
2651
- #r = void 0;
2652
- #s;
2651
+ #s = void 0;
2652
+ #r;
2653
2653
  #o;
2654
2654
  #a;
2655
2655
  #i;
@@ -2711,10 +2711,10 @@ var Si = class extends we {
2711
2711
  }
2712
2712
  getOptimisticResult(t) {
2713
2713
  const e = this.#e.getQueryCache().build(this.#e, t), n = this.createResult(e, t);
2714
- return Ai(this, n) && (this.#r = n, this.#o = this.options, this.#s = this.#t.state), n;
2714
+ return Ai(this, n) && (this.#s = n, this.#o = this.options, this.#r = this.#t.state), n;
2715
2715
  }
2716
2716
  getCurrentResult() {
2717
- return this.#r;
2717
+ return this.#s;
2718
2718
  }
2719
2719
  trackResult(t, e) {
2720
2720
  return new Proxy(t, {
@@ -2744,7 +2744,7 @@ var Si = class extends we {
2744
2744
  return this.#f({
2745
2745
  ...t,
2746
2746
  cancelRefetch: t.cancelRefetch ?? !0
2747
- }).then(() => (this.updateResult(), this.#r));
2747
+ }).then(() => (this.updateResult(), this.#s));
2748
2748
  }
2749
2749
  #f(t) {
2750
2750
  this.#E();
@@ -2760,11 +2760,11 @@ var Si = class extends we {
2760
2760
  this.options.staleTime,
2761
2761
  this.#t
2762
2762
  );
2763
- if (ce || this.#r.isStale || !lt(t))
2763
+ if (ce || this.#s.isStale || !lt(t))
2764
2764
  return;
2765
- const n = tr(this.#r.dataUpdatedAt, t) + 1;
2765
+ const n = tr(this.#s.dataUpdatedAt, t) + 1;
2766
2766
  this.#c = se.setTimeout(() => {
2767
- this.#r.isStale || this.updateResult();
2767
+ this.#s.isStale || this.updateResult();
2768
2768
  }, n);
2769
2769
  }
2770
2770
  #g() {
@@ -2785,7 +2785,7 @@ var Si = class extends we {
2785
2785
  this.#l && (se.clearInterval(this.#l), this.#l = void 0);
2786
2786
  }
2787
2787
  createResult(t, e) {
2788
- const n = this.#t, r = this.options, s = this.#r, i = this.#s, o = this.#o, u = t !== n ? t.state : this.#n, { state: l } = t;
2788
+ const n = this.#t, r = this.options, s = this.#s, i = this.#r, o = this.#o, u = t !== n ? t.state : this.#n, { state: l } = t;
2789
2789
  let c = { ...l }, f = !1, g;
2790
2790
  if (e._optimisticResults) {
2791
2791
  const P = this.hasListeners(), I = !P && cn(t, e), j = P && ln(t, n, e, r);
@@ -2868,10 +2868,10 @@ var Si = class extends we {
2868
2868
  return T;
2869
2869
  }
2870
2870
  updateResult() {
2871
- const t = this.#r, e = this.createResult(this.#t, this.options);
2872
- if (this.#s = this.#t.state, this.#o = this.options, this.#s.data !== void 0 && (this.#h = this.#t), Qe(e, t))
2871
+ const t = this.#s, e = this.createResult(this.#t, this.options);
2872
+ if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#h = this.#t), Qe(e, t))
2873
2873
  return;
2874
- this.#r = e;
2874
+ this.#s = e;
2875
2875
  const n = () => {
2876
2876
  if (!t)
2877
2877
  return !0;
@@ -2881,9 +2881,9 @@ var Si = class extends we {
2881
2881
  const i = new Set(
2882
2882
  s ?? this.#p
2883
2883
  );
2884
- return this.options.throwOnError && i.add("error"), Object.keys(this.#r).some((o) => {
2884
+ return this.options.throwOnError && i.add("error"), Object.keys(this.#s).some((o) => {
2885
2885
  const a = o;
2886
- return this.#r[a] !== t[a] && i.has(a);
2886
+ return this.#s[a] !== t[a] && i.has(a);
2887
2887
  });
2888
2888
  };
2889
2889
  this.#S({ listeners: n() });
@@ -2901,7 +2901,7 @@ var Si = class extends we {
2901
2901
  #S(t) {
2902
2902
  q.batch(() => {
2903
2903
  t.listeners && this.listeners.forEach((e) => {
2904
- e(this.#r);
2904
+ e(this.#s);
2905
2905
  }), this.#e.getQueryCache().notify({
2906
2906
  query: this.#t,
2907
2907
  type: "observerResultsUpdated"
@@ -3011,8 +3011,9 @@ var Ci = class extends ir {
3011
3011
  #e;
3012
3012
  #t;
3013
3013
  #n;
3014
+ #s;
3014
3015
  constructor(t) {
3015
- super(), this.mutationId = t.mutationId, this.#t = t.mutationCache, this.#e = [], this.state = t.state || ar(), this.setOptions(t.options), this.scheduleGc();
3016
+ super(), this.#e = t.client, this.mutationId = t.mutationId, this.#n = t.mutationCache, this.#t = [], this.state = t.state || ar(), this.setOptions(t.options), this.scheduleGc();
3016
3017
  }
3017
3018
  setOptions(t) {
3018
3019
  this.options = t, this.updateGcTime(this.options.gcTime);
@@ -3021,34 +3022,38 @@ var Ci = class extends ir {
3021
3022
  return this.options.meta;
3022
3023
  }
3023
3024
  addObserver(t) {
3024
- this.#e.includes(t) || (this.#e.push(t), this.clearGcTimeout(), this.#t.notify({
3025
+ this.#t.includes(t) || (this.#t.push(t), this.clearGcTimeout(), this.#n.notify({
3025
3026
  type: "observerAdded",
3026
3027
  mutation: this,
3027
3028
  observer: t
3028
3029
  }));
3029
3030
  }
3030
3031
  removeObserver(t) {
3031
- this.#e = this.#e.filter((e) => e !== t), this.scheduleGc(), this.#t.notify({
3032
+ this.#t = this.#t.filter((e) => e !== t), this.scheduleGc(), this.#n.notify({
3032
3033
  type: "observerRemoved",
3033
3034
  mutation: this,
3034
3035
  observer: t
3035
3036
  });
3036
3037
  }
3037
3038
  optionalRemove() {
3038
- this.#e.length || (this.state.status === "pending" ? this.scheduleGc() : this.#t.remove(this));
3039
+ this.#t.length || (this.state.status === "pending" ? this.scheduleGc() : this.#n.remove(this));
3039
3040
  }
3040
3041
  continue() {
3041
- return this.#n?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
3042
+ return this.#s?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
3042
3043
  this.execute(this.state.variables);
3043
3044
  }
3044
3045
  async execute(t) {
3045
3046
  const e = () => {
3046
3047
  this.#r({ type: "continue" });
3048
+ }, n = {
3049
+ client: this.#e,
3050
+ meta: this.options.meta,
3051
+ mutationKey: this.options.mutationKey
3047
3052
  };
3048
- this.#n = sr({
3049
- fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
3050
- onFail: (s, i) => {
3051
- this.#r({ type: "failed", failureCount: s, error: i });
3053
+ this.#s = sr({
3054
+ fn: () => this.options.mutationFn ? this.options.mutationFn(t, n) : Promise.reject(new Error("No mutationFn found")),
3055
+ onFail: (i, o) => {
3056
+ this.#r({ type: "failed", failureCount: i, error: o });
3052
3057
  },
3053
3058
  onPause: () => {
3054
3059
  this.#r({ type: "pause" });
@@ -3057,66 +3062,87 @@ var Ci = class extends ir {
3057
3062
  retry: this.options.retry ?? 0,
3058
3063
  retryDelay: this.options.retryDelay,
3059
3064
  networkMode: this.options.networkMode,
3060
- canRun: () => this.#t.canRun(this)
3065
+ canRun: () => this.#n.canRun(this)
3061
3066
  });
3062
- const n = this.state.status === "pending", r = !this.#n.canStart();
3067
+ const r = this.state.status === "pending", s = !this.#s.canStart();
3063
3068
  try {
3064
- if (n)
3069
+ if (r)
3065
3070
  e();
3066
3071
  else {
3067
- this.#r({ type: "pending", variables: t, isPaused: r }), await this.#t.config.onMutate?.(
3072
+ this.#r({ type: "pending", variables: t, isPaused: s }), await this.#n.config.onMutate?.(
3068
3073
  t,
3069
- this
3074
+ this,
3075
+ n
3076
+ );
3077
+ const o = await this.options.onMutate?.(
3078
+ t,
3079
+ n
3070
3080
  );
3071
- const i = await this.options.onMutate?.(t);
3072
- i !== this.state.context && this.#r({
3081
+ o !== this.state.context && this.#r({
3073
3082
  type: "pending",
3074
- context: i,
3083
+ context: o,
3075
3084
  variables: t,
3076
- isPaused: r
3085
+ isPaused: s
3077
3086
  });
3078
3087
  }
3079
- const s = await this.#n.start();
3080
- return await this.#t.config.onSuccess?.(
3081
- s,
3088
+ const i = await this.#s.start();
3089
+ return await this.#n.config.onSuccess?.(
3090
+ i,
3082
3091
  t,
3083
3092
  this.state.context,
3084
- this
3085
- ), await this.options.onSuccess?.(s, t, this.state.context), await this.#t.config.onSettled?.(
3086
- s,
3093
+ this,
3094
+ n
3095
+ ), await this.options.onSuccess?.(
3096
+ i,
3097
+ t,
3098
+ this.state.context,
3099
+ n
3100
+ ), await this.#n.config.onSettled?.(
3101
+ i,
3087
3102
  null,
3088
3103
  this.state.variables,
3089
3104
  this.state.context,
3090
- this
3091
- ), await this.options.onSettled?.(s, null, t, this.state.context), this.#r({ type: "success", data: s }), s;
3092
- } catch (s) {
3105
+ this,
3106
+ n
3107
+ ), await this.options.onSettled?.(
3108
+ i,
3109
+ null,
3110
+ t,
3111
+ this.state.context,
3112
+ n
3113
+ ), this.#r({ type: "success", data: i }), i;
3114
+ } catch (i) {
3093
3115
  try {
3094
- throw await this.#t.config.onError?.(
3095
- s,
3116
+ throw await this.#n.config.onError?.(
3117
+ i,
3096
3118
  t,
3097
3119
  this.state.context,
3098
- this
3120
+ this,
3121
+ n
3099
3122
  ), await this.options.onError?.(
3100
- s,
3123
+ i,
3101
3124
  t,
3102
- this.state.context
3103
- ), await this.#t.config.onSettled?.(
3125
+ this.state.context,
3126
+ n
3127
+ ), await this.#n.config.onSettled?.(
3104
3128
  void 0,
3105
- s,
3129
+ i,
3106
3130
  this.state.variables,
3107
3131
  this.state.context,
3108
- this
3132
+ this,
3133
+ n
3109
3134
  ), await this.options.onSettled?.(
3110
3135
  void 0,
3111
- s,
3136
+ i,
3112
3137
  t,
3113
- this.state.context
3114
- ), s;
3138
+ this.state.context,
3139
+ n
3140
+ ), i;
3115
3141
  } finally {
3116
- this.#r({ type: "error", error: s });
3142
+ this.#r({ type: "error", error: i });
3117
3143
  }
3118
3144
  } finally {
3119
- this.#t.runNext(this);
3145
+ this.#n.runNext(this);
3120
3146
  }
3121
3147
  }
3122
3148
  #r(t) {
@@ -3174,9 +3200,9 @@ var Ci = class extends ir {
3174
3200
  }
3175
3201
  };
3176
3202
  this.state = e(this.state), q.batch(() => {
3177
- this.#e.forEach((n) => {
3203
+ this.#t.forEach((n) => {
3178
3204
  n.onMutationUpdate(t);
3179
- }), this.#t.notify({
3205
+ }), this.#n.notify({
3180
3206
  mutation: this,
3181
3207
  type: "updated",
3182
3208
  action: t
@@ -3206,6 +3232,7 @@ var ur = class extends we {
3206
3232
  #n;
3207
3233
  build(e, n, r) {
3208
3234
  const s = new Ci({
3235
+ client: e,
3209
3236
  mutationCache: this,
3210
3237
  mutationId: ++this.#n,
3211
3238
  options: e.defaultMutationOptions(n),
@@ -3292,9 +3319,9 @@ var Pi = class extends we {
3292
3319
  #e;
3293
3320
  #t = void 0;
3294
3321
  #n;
3295
- #r;
3322
+ #s;
3296
3323
  constructor(t, e) {
3297
- super(), this.#e = t, this.setOptions(e), this.bindMethods(), this.#s();
3324
+ super(), this.#e = t, this.setOptions(e), this.bindMethods(), this.#r();
3298
3325
  }
3299
3326
  bindMethods() {
3300
3327
  this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
@@ -3311,18 +3338,18 @@ var Pi = class extends we {
3311
3338
  this.hasListeners() || this.#n?.removeObserver(this);
3312
3339
  }
3313
3340
  onMutationUpdate(t) {
3314
- this.#s(), this.#o(t);
3341
+ this.#r(), this.#o(t);
3315
3342
  }
3316
3343
  getCurrentResult() {
3317
3344
  return this.#t;
3318
3345
  }
3319
3346
  reset() {
3320
- this.#n?.removeObserver(this), this.#n = void 0, this.#s(), this.#o();
3347
+ this.#n?.removeObserver(this), this.#n = void 0, this.#r(), this.#o();
3321
3348
  }
3322
3349
  mutate(t, e) {
3323
- return this.#r = e, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(t);
3350
+ return this.#s = e, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(t);
3324
3351
  }
3325
- #s() {
3352
+ #r() {
3326
3353
  const t = this.#n?.state ?? ar();
3327
3354
  this.#t = {
3328
3355
  ...t,
@@ -3336,13 +3363,34 @@ var Pi = class extends we {
3336
3363
  }
3337
3364
  #o(t) {
3338
3365
  q.batch(() => {
3339
- if (this.#r && this.hasListeners()) {
3340
- const e = this.#t.variables, n = this.#t.context;
3341
- t?.type === "success" ? (this.#r.onSuccess?.(t.data, e, n), this.#r.onSettled?.(t.data, null, e, n)) : t?.type === "error" && (this.#r.onError?.(t.error, e, n), this.#r.onSettled?.(
3366
+ if (this.#s && this.hasListeners()) {
3367
+ const e = this.#t.variables, n = this.#t.context, r = {
3368
+ client: this.#e,
3369
+ meta: this.options.meta,
3370
+ mutationKey: this.options.mutationKey
3371
+ };
3372
+ t?.type === "success" ? (this.#s.onSuccess?.(
3373
+ t.data,
3374
+ e,
3375
+ n,
3376
+ r
3377
+ ), this.#s.onSettled?.(
3378
+ t.data,
3379
+ null,
3380
+ e,
3381
+ n,
3382
+ r
3383
+ )) : t?.type === "error" && (this.#s.onError?.(
3384
+ t.error,
3385
+ e,
3386
+ n,
3387
+ r
3388
+ ), this.#s.onSettled?.(
3342
3389
  void 0,
3343
3390
  t.error,
3344
3391
  e,
3345
- n
3392
+ n,
3393
+ r
3346
3394
  ));
3347
3395
  }
3348
3396
  this.listeners.forEach((e) => {
@@ -3425,13 +3473,13 @@ var Pi = class extends we {
3425
3473
  #e;
3426
3474
  #t;
3427
3475
  #n;
3428
- #r;
3429
3476
  #s;
3477
+ #r;
3430
3478
  #o;
3431
3479
  #a;
3432
3480
  #i;
3433
3481
  constructor(e = {}) {
3434
- this.#e = e.queryCache || new cr(), this.#t = e.mutationCache || new ur(), this.#n = e.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#s = /* @__PURE__ */ new Map(), this.#o = 0;
3482
+ this.#e = e.queryCache || new cr(), this.#t = e.mutationCache || new ur(), this.#n = e.defaultOptions || {}, this.#s = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#o = 0;
3435
3483
  }
3436
3484
  mount() {
3437
3485
  this.#o++, this.#o === 1 && (this.#a = _t.subscribe(async (e) => {
@@ -3576,25 +3624,25 @@ var Pi = class extends we {
3576
3624
  this.#n = e;
3577
3625
  }
3578
3626
  setQueryDefaults(e, n) {
3579
- this.#r.set(le(e), {
3627
+ this.#s.set(le(e), {
3580
3628
  queryKey: e,
3581
3629
  defaultOptions: n
3582
3630
  });
3583
3631
  }
3584
3632
  getQueryDefaults(e) {
3585
- const n = [...this.#r.values()], r = {};
3633
+ const n = [...this.#s.values()], r = {};
3586
3634
  return n.forEach((s) => {
3587
3635
  Re(e, s.queryKey) && Object.assign(r, s.defaultOptions);
3588
3636
  }), r;
3589
3637
  }
3590
3638
  setMutationDefaults(e, n) {
3591
- this.#s.set(le(e), {
3639
+ this.#r.set(le(e), {
3592
3640
  mutationKey: e,
3593
3641
  defaultOptions: n
3594
3642
  });
3595
3643
  }
3596
3644
  getMutationDefaults(e) {
3597
- const n = [...this.#s.values()], r = {};
3645
+ const n = [...this.#r.values()], r = {};
3598
3646
  return n.forEach((s) => {
3599
3647
  Re(e, s.mutationKey) && Object.assign(r, s.defaultOptions);
3600
3648
  }), r;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-helpers",
3
3
  "description": "Mhz helpers and composables",
4
- "version": "1.2.16",
4
+ "version": "1.2.18",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -24,27 +24,27 @@
24
24
  "test:cov": "vitest run --coverage"
25
25
  },
26
26
  "dependencies": {
27
- "@tanstack/vue-query": "5.87.4",
27
+ "@tanstack/vue-query": "5.90.2",
28
28
  "@vueuse/core": "13.9.0",
29
29
  "@vueuse/integrations": "13.9.0",
30
30
  "async-validator": "4.2.5",
31
31
  "axios": "1.12.2",
32
- "vue": "3.5.21",
32
+ "vue": "3.5.22",
33
33
  "vue-router": "4.5.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@eslint/js": "9.35.0",
37
- "@types/node": "24.4.0",
36
+ "@eslint/js": "9.36.0",
37
+ "@types/node": "24.5.2",
38
38
  "@vitejs/plugin-vue": "6.0.1",
39
39
  "@vitest/coverage-istanbul": "3.2.4",
40
- "eslint": "9.35.0",
40
+ "eslint": "9.36.0",
41
41
  "eslint-config-prettier": "10.1.8",
42
42
  "eslint-import-resolver-typescript": "4.4.4",
43
43
  "eslint-plugin-import-x": "4.16.1",
44
44
  "eslint-plugin-sonarjs": "3.0.5",
45
45
  "eslint-plugin-prettier": "5.5.4",
46
46
  "eslint-plugin-unicorn": "61.0.2",
47
- "eslint-plugin-vue": "10.4.0",
47
+ "eslint-plugin-vue": "10.5.0",
48
48
  "globals": "16.4.0",
49
49
  "happy-dom": "18.0.1",
50
50
  "postcss-html": "1.8.0",
@@ -56,16 +56,16 @@
56
56
  "stylelint-order": "7.0.0",
57
57
  "stylelint-prettier": "5.0.3",
58
58
  "typescript": "5.9.2",
59
- "typescript-eslint": "8.43.0",
60
- "vite": "7.1.5",
59
+ "typescript-eslint": "8.44.1",
60
+ "vite": "7.1.7",
61
61
  "vite-plugin-dts": "4.5.4",
62
62
  "vitest": "3.2.4",
63
63
  "vue-eslint-parser": "10.2.0",
64
64
  "vue-linters-config": "0.5.4",
65
- "vue-tsc": "3.0.7"
65
+ "vue-tsc": "3.0.8"
66
66
  },
67
67
  "peerDependencies": {
68
- "vue": "3.5.21",
68
+ "vue": "3.5.22",
69
69
  "vue-router": "4.5.1"
70
70
  },
71
71
  "engines": {