@vueuse/integrations 10.3.0 → 10.4.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 (81) hide show
  1. package/index.cjs +62 -214
  2. package/index.d.cts +8 -18
  3. package/index.d.mts +8 -18
  4. package/index.d.ts +8 -18
  5. package/index.iife.js +62 -214
  6. package/index.iife.min.js +1 -1
  7. package/index.mjs +64 -216
  8. package/package.json +6 -6
  9. package/useAsyncValidator/component.cjs +5 -29
  10. package/useAsyncValidator/component.mjs +5 -29
  11. package/useAsyncValidator.cjs +5 -29
  12. package/useAsyncValidator.d.cts +1 -1
  13. package/useAsyncValidator.d.mts +1 -1
  14. package/useAsyncValidator.d.ts +1 -1
  15. package/useAsyncValidator.iife.js +5 -29
  16. package/useAsyncValidator.iife.min.js +1 -1
  17. package/useAsyncValidator.mjs +5 -29
  18. package/useAxios.cjs +8 -25
  19. package/useAxios.d.cts +1 -1
  20. package/useAxios.d.mts +1 -1
  21. package/useAxios.d.ts +1 -1
  22. package/useAxios.iife.js +8 -25
  23. package/useAxios.iife.min.js +1 -1
  24. package/useAxios.mjs +8 -25
  25. package/useChangeCase.d.cts +2 -14
  26. package/useChangeCase.d.mts +2 -14
  27. package/useChangeCase.d.ts +2 -14
  28. package/useCookies.cjs +2 -18
  29. package/useCookies.iife.js +2 -18
  30. package/useCookies.iife.min.js +1 -1
  31. package/useCookies.mjs +2 -18
  32. package/useDrauu.cjs +8 -43
  33. package/useDrauu.d.cts +1 -1
  34. package/useDrauu.d.mts +1 -1
  35. package/useDrauu.d.ts +1 -1
  36. package/useDrauu.iife.js +8 -43
  37. package/useDrauu.iife.min.js +1 -1
  38. package/useDrauu.mjs +8 -43
  39. package/useFocusTrap/component.d.cts +1 -1
  40. package/useFocusTrap/component.d.mts +1 -1
  41. package/useFocusTrap/component.d.ts +1 -1
  42. package/useFocusTrap.cjs +4 -34
  43. package/useFocusTrap.d.cts +1 -1
  44. package/useFocusTrap.d.mts +1 -1
  45. package/useFocusTrap.d.ts +1 -1
  46. package/useFocusTrap.iife.js +4 -34
  47. package/useFocusTrap.iife.min.js +1 -1
  48. package/useFocusTrap.mjs +4 -34
  49. package/useFuse.cjs +5 -9
  50. package/useFuse.d.cts +1 -1
  51. package/useFuse.d.mts +1 -1
  52. package/useFuse.d.ts +1 -1
  53. package/useFuse.iife.js +5 -9
  54. package/useFuse.iife.min.js +1 -1
  55. package/useFuse.mjs +5 -9
  56. package/useIDBKeyval.cjs +17 -19
  57. package/useIDBKeyval.d.cts +8 -6
  58. package/useIDBKeyval.d.mts +8 -6
  59. package/useIDBKeyval.d.ts +8 -6
  60. package/useIDBKeyval.iife.js +18 -21
  61. package/useIDBKeyval.iife.min.js +1 -1
  62. package/useIDBKeyval.mjs +18 -20
  63. package/useJwt.cjs +1 -1
  64. package/useJwt.d.cts +1 -1
  65. package/useJwt.d.mts +1 -1
  66. package/useJwt.d.ts +1 -1
  67. package/useJwt.iife.js +1 -1
  68. package/useJwt.iife.min.js +1 -1
  69. package/useJwt.mjs +1 -1
  70. package/useNProgress.d.cts +1 -1
  71. package/useNProgress.d.mts +1 -1
  72. package/useNProgress.d.ts +1 -1
  73. package/useSortable/component.cjs +13 -36
  74. package/useSortable/component.mjs +14 -37
  75. package/useSortable.cjs +13 -36
  76. package/useSortable.d.cts +1 -1
  77. package/useSortable.d.mts +1 -1
  78. package/useSortable.d.ts +1 -1
  79. package/useSortable.iife.js +13 -36
  80. package/useSortable.iife.min.js +1 -1
  81. package/useSortable.mjs +14 -37
@@ -4,25 +4,6 @@ var shared = require('@vueuse/shared');
4
4
  var Schema = require('async-validator');
5
5
  var vueDemi = require('vue-demi');
6
6
 
7
- var __defProp = Object.defineProperty;
8
- var __defProps = Object.defineProperties;
9
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
10
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
7
  const AsyncValidatorSchema = Schema.default || Schema;
27
8
  function useAsyncValidator(value, rules, options = {}) {
28
9
  const {
@@ -34,14 +15,8 @@ function useAsyncValidator(value, rules, options = {}) {
34
15
  const errorInfo = vueDemi.shallowRef(null);
35
16
  const isFinished = vueDemi.ref(true);
36
17
  const pass = vueDemi.ref(!immediate || manual);
37
- const errors = vueDemi.computed(() => {
38
- var _a;
39
- return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
40
- });
41
- const errorFields = vueDemi.computed(() => {
42
- var _a;
43
- return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
44
- });
18
+ const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
19
+ const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
45
20
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
46
21
  const execute = async () => {
47
22
  isFinished.value = false;
@@ -82,11 +57,12 @@ function useAsyncValidator(value, rules, options = {}) {
82
57
  shared.until(isFinished).toBe(true).then(() => resolve(shell)).catch((error) => reject(error));
83
58
  });
84
59
  }
85
- return __spreadProps(__spreadValues({}, shell), {
60
+ return {
61
+ ...shell,
86
62
  then(onFulfilled, onRejected) {
87
63
  return waitUntilFinished().then(onFulfilled, onRejected);
88
64
  }
89
- });
65
+ };
90
66
  }
91
67
 
92
68
  exports.useAsyncValidator = useAsyncValidator;
@@ -45,4 +45,4 @@ interface UseAsyncValidatorOptions {
45
45
  */
46
46
  declare function useAsyncValidator(value: MaybeRefOrGetter<Record<string, any>>, rules: MaybeRefOrGetter<Rules>, options?: UseAsyncValidatorOptions): UseAsyncValidatorReturn & PromiseLike<UseAsyncValidatorReturn>;
47
47
 
48
- export { AsyncValidatorError, UseAsyncValidatorExecuteReturn, UseAsyncValidatorOptions, UseAsyncValidatorReturn, useAsyncValidator };
48
+ export { type AsyncValidatorError, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, useAsyncValidator };
@@ -45,4 +45,4 @@ interface UseAsyncValidatorOptions {
45
45
  */
46
46
  declare function useAsyncValidator(value: MaybeRefOrGetter<Record<string, any>>, rules: MaybeRefOrGetter<Rules>, options?: UseAsyncValidatorOptions): UseAsyncValidatorReturn & PromiseLike<UseAsyncValidatorReturn>;
47
47
 
48
- export { AsyncValidatorError, UseAsyncValidatorExecuteReturn, UseAsyncValidatorOptions, UseAsyncValidatorReturn, useAsyncValidator };
48
+ export { type AsyncValidatorError, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, useAsyncValidator };
@@ -45,4 +45,4 @@ interface UseAsyncValidatorOptions {
45
45
  */
46
46
  declare function useAsyncValidator(value: MaybeRefOrGetter<Record<string, any>>, rules: MaybeRefOrGetter<Rules>, options?: UseAsyncValidatorOptions): UseAsyncValidatorReturn & PromiseLike<UseAsyncValidatorReturn>;
47
47
 
48
- export { AsyncValidatorError, UseAsyncValidatorExecuteReturn, UseAsyncValidatorOptions, UseAsyncValidatorReturn, useAsyncValidator };
48
+ export { type AsyncValidatorError, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, useAsyncValidator };
@@ -117,25 +117,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
117
117
  ;(function (exports, shared, Schema, vueDemi) {
118
118
  'use strict';
119
119
 
120
- var __defProp = Object.defineProperty;
121
- var __defProps = Object.defineProperties;
122
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
123
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
124
- var __hasOwnProp = Object.prototype.hasOwnProperty;
125
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
126
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
127
- var __spreadValues = (a, b) => {
128
- for (var prop in b || (b = {}))
129
- if (__hasOwnProp.call(b, prop))
130
- __defNormalProp(a, prop, b[prop]);
131
- if (__getOwnPropSymbols)
132
- for (var prop of __getOwnPropSymbols(b)) {
133
- if (__propIsEnum.call(b, prop))
134
- __defNormalProp(a, prop, b[prop]);
135
- }
136
- return a;
137
- };
138
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
139
120
  const AsyncValidatorSchema = Schema.default || Schema;
140
121
  function useAsyncValidator(value, rules, options = {}) {
141
122
  const {
@@ -147,14 +128,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
147
128
  const errorInfo = vueDemi.shallowRef(null);
148
129
  const isFinished = vueDemi.ref(true);
149
130
  const pass = vueDemi.ref(!immediate || manual);
150
- const errors = vueDemi.computed(() => {
151
- var _a;
152
- return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
153
- });
154
- const errorFields = vueDemi.computed(() => {
155
- var _a;
156
- return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
157
- });
131
+ const errors = vueDemi.computed(() => errorInfo.value?.errors || []);
132
+ const errorFields = vueDemi.computed(() => errorInfo.value?.fields || {});
158
133
  const validator = vueDemi.computed(() => new AsyncValidatorSchema(shared.toValue(rules)));
159
134
  const execute = async () => {
160
135
  isFinished.value = false;
@@ -195,11 +170,12 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
195
170
  shared.until(isFinished).toBe(true).then(() => resolve(shell)).catch((error) => reject(error));
196
171
  });
197
172
  }
198
- return __spreadProps(__spreadValues({}, shell), {
173
+ return {
174
+ ...shell,
199
175
  then(onFulfilled, onRejected) {
200
176
  return waitUntilFinished().then(onFulfilled, onRejected);
201
177
  }
202
- });
178
+ };
203
179
  }
204
180
 
205
181
  exports.useAsyncValidator = useAsyncValidator;
@@ -1 +1 @@
1
- var VueDemi=function(r,n,v){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let o=function(i,f){var c,y={},h={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(u,d){return y[u]=d,this},directive:function(u,d){return d?(n.directive(u,d),h):n.directive(u)},mount:function(u,d){return c||(c=new n(Object.assign({propsData:f},i,{provide:Object.assign(y,i.provide)})),c.$mount(u,d),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return h};var P=o;for(var e in n)r[e]=n[e];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.hasInjectionContext=()=>!!r.getCurrentInstance(),r.createApp=o}else if(n.version.slice(0,2)==="2.")if(v){for(var e in v)r[e]=v[e];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.hasInjectionContext=()=>!!r.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var e in n)r[e]=n[e];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(o,i,f){return Array.isArray(o)?(o.length=Math.max(o.length,i),o.splice(i,1,f),f):(o[i]=f,f)},r.del=function(o,i){if(Array.isArray(o)){o.splice(i,1);return}delete o[i]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return r}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(r,n,v,e){"use strict";var P=Object.defineProperty,o=Object.defineProperties,i=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,h=(a,t,s)=>t in a?P(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,u=(a,t)=>{for(var s in t||(t={}))c.call(t,s)&&h(a,s,t[s]);if(f)for(var s of f(t))y.call(t,s)&&h(a,s,t[s]);return a},d=(a,t)=>o(a,i(t));const U=v.default||v;function R(a,t,s={}){const{validateOption:E={},immediate:b=!0,manual:A=!1}=s,I=n.toRef(a),p=e.shallowRef(null),_=e.ref(!0),w=e.ref(!b||A),j=e.computed(()=>{var l;return((l=p.value)==null?void 0:l.errors)||[]}),g=e.computed(()=>{var l;return((l=p.value)==null?void 0:l.fields)||{}}),x=e.computed(()=>new U(n.toValue(t))),C=async()=>{_.value=!1,w.value=!1;try{await x.value.validate(I.value,E),w.value=!0,p.value=null}catch(l){p.value=l}finally{_.value=!0}return{pass:w.value,errorInfo:p.value,errors:j.value,errorFields:g.value}};A||e.watch([I,x],()=>C(),{immediate:b,deep:!0});const F={isFinished:_,pass:w,errors:j,errorInfo:p,errorFields:g,execute:C};function S(){return new Promise((l,O)=>{n.until(_).toBe(!0).then(()=>l(F)).catch($=>O($))})}return d(u({},F),{then(l,O){return S().then(l,O)}})}r.useAsyncValidator=R})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi);
1
+ var VueDemi=function(n,r,c){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let e=function(s,l){var o,v={},u={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(i,a){return v[i]=a,this},directive:function(i,a){return a?(r.directive(i,a),u):r.directive(i)},mount:function(i,a){return o||(o=new r(Object.assign({propsData:l},s,{provide:Object.assign(v,s.provide)})),o.$mount(i,a),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return u};var A=e;for(var t in r)n[t]=r[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=e}else if(r.version.slice(0,2)==="2.")if(c){for(var t in c)n[t]=c[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var t in r)n[t]=r[t];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(e,s,l){return Array.isArray(e)?(e.length=Math.max(e.length,s),e.splice(s,1,l),l):(e[s]=l,l)},n.del=function(e,s){if(Array.isArray(e)){e.splice(s,1);return}delete e[s]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,r,c,t){"use strict";const A=c.default||c;function e(s,l,o={}){const{validateOption:v={},immediate:u=!0,manual:i=!1}=o,a=r.toRef(s),f=t.shallowRef(null),p=t.ref(!0),h=t.ref(!u||i),b=t.computed(()=>f.value?.errors||[]),w=t.computed(()=>f.value?.fields||{}),I=t.computed(()=>new A(r.toValue(l))),x=async()=>{p.value=!1,h.value=!1;try{await I.value.validate(a.value,v),h.value=!0,f.value=null}catch(d){f.value=d}finally{p.value=!0}return{pass:h.value,errorInfo:f.value,errors:b.value,errorFields:w.value}};i||t.watch([a,I],()=>x(),{immediate:u,deep:!0});const C={isFinished:p,pass:h,errors:b,errorInfo:f,errorFields:w,execute:x};function j(){return new Promise((d,y)=>{r.until(p).toBe(!0).then(()=>d(C)).catch(F=>y(F))})}return{...C,then(d,y){return j().then(d,y)}}}n.useAsyncValidator=e})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi);
@@ -2,25 +2,6 @@ import { toRef, toValue, until } from '@vueuse/shared';
2
2
  import Schema from 'async-validator';
3
3
  import { shallowRef, ref, computed, watch } from 'vue-demi';
4
4
 
5
- var __defProp = Object.defineProperty;
6
- var __defProps = Object.defineProperties;
7
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
5
  const AsyncValidatorSchema = Schema.default || Schema;
25
6
  function useAsyncValidator(value, rules, options = {}) {
26
7
  const {
@@ -32,14 +13,8 @@ function useAsyncValidator(value, rules, options = {}) {
32
13
  const errorInfo = shallowRef(null);
33
14
  const isFinished = ref(true);
34
15
  const pass = ref(!immediate || manual);
35
- const errors = computed(() => {
36
- var _a;
37
- return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
38
- });
39
- const errorFields = computed(() => {
40
- var _a;
41
- return ((_a = errorInfo.value) == null ? void 0 : _a.fields) || {};
42
- });
16
+ const errors = computed(() => errorInfo.value?.errors || []);
17
+ const errorFields = computed(() => errorInfo.value?.fields || {});
43
18
  const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
44
19
  const execute = async () => {
45
20
  isFinished.value = false;
@@ -80,11 +55,12 @@ function useAsyncValidator(value, rules, options = {}) {
80
55
  until(isFinished).toBe(true).then(() => resolve(shell)).catch((error) => reject(error));
81
56
  });
82
57
  }
83
- return __spreadProps(__spreadValues({}, shell), {
58
+ return {
59
+ ...shell,
84
60
  then(onFulfilled, onRejected) {
85
61
  return waitUntilFinished().then(onFulfilled, onRejected);
86
62
  }
87
- });
63
+ };
88
64
  }
89
65
 
90
66
  export { useAsyncValidator };
package/useAxios.cjs CHANGED
@@ -4,25 +4,6 @@ var vueDemi = require('vue-demi');
4
4
  var shared = require('@vueuse/shared');
5
5
  var axios = require('axios');
6
6
 
7
- var __defProp = Object.defineProperty;
8
- var __defProps = Object.defineProperties;
9
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
10
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
7
  function useAxios(...args) {
27
8
  const url = typeof args[0] === "string" ? args[0] : void 0;
28
9
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
@@ -32,7 +13,7 @@ function useAxios(...args) {
32
13
  immediate: !!argsPlaceholder,
33
14
  shallow: true
34
15
  };
35
- const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
16
+ const isAxiosInstance = (val) => !!val?.request;
36
17
  if (args.length > 0 + argsPlaceholder) {
37
18
  if (isAxiosInstance(args[0 + argsPlaceholder]))
38
19
  instance = args[0 + argsPlaceholder];
@@ -88,7 +69,7 @@ function useAxios(...args) {
88
69
  let executeCounter = 0;
89
70
  const execute = (executeUrl = url, config = {}) => {
90
71
  error.value = void 0;
91
- const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
72
+ const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
92
73
  if (_url === void 0) {
93
74
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
94
75
  isFinished.value = true;
@@ -99,7 +80,7 @@ function useAxios(...args) {
99
80
  loading(true);
100
81
  executeCounter += 1;
101
82
  const currentExecuteCounter = executeCounter;
102
- instance(_url, __spreadProps(__spreadValues(__spreadValues({}, defaultConfig), typeof executeUrl === "object" ? executeUrl : config), { cancelToken: cancelToken.token })).then((r) => {
83
+ instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, cancelToken: cancelToken.token }).then((r) => {
103
84
  response.value = r;
104
85
  const result2 = r.data;
105
86
  data.value = result2;
@@ -108,8 +89,7 @@ function useAxios(...args) {
108
89
  error.value = e;
109
90
  onError(e);
110
91
  }).finally(() => {
111
- var _a;
112
- (_a = options.onFinish) == null ? void 0 : _a.call(options);
92
+ options.onFinish?.();
113
93
  if (currentExecuteCounter === executeCounter)
114
94
  loading(false);
115
95
  });
@@ -129,7 +109,10 @@ function useAxios(...args) {
129
109
  abort,
130
110
  execute
131
111
  };
132
- return __spreadValues(__spreadValues({}, result), promise);
112
+ return {
113
+ ...result,
114
+ ...promise
115
+ };
133
116
  }
134
117
 
135
118
  exports.useAxios = useAxios;
package/useAxios.d.cts CHANGED
@@ -91,4 +91,4 @@ declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: Axios
91
91
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
92
92
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>, instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
93
93
 
94
- export { EasyUseAxiosReturn, StrictUseAxiosReturn, UseAxiosOptions, UseAxiosReturn, useAxios };
94
+ export { type EasyUseAxiosReturn, type StrictUseAxiosReturn, type UseAxiosOptions, type UseAxiosReturn, useAxios };
package/useAxios.d.mts CHANGED
@@ -91,4 +91,4 @@ declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: Axios
91
91
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
92
92
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>, instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
93
93
 
94
- export { EasyUseAxiosReturn, StrictUseAxiosReturn, UseAxiosOptions, UseAxiosReturn, useAxios };
94
+ export { type EasyUseAxiosReturn, type StrictUseAxiosReturn, type UseAxiosOptions, type UseAxiosReturn, useAxios };
package/useAxios.d.ts CHANGED
@@ -91,4 +91,4 @@ declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: Axios
91
91
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
92
92
  declare function useAxios<T = any, R = AxiosResponse<T>, D = any>(config?: AxiosRequestConfig<D>, instance?: AxiosInstance): EasyUseAxiosReturn<T, R, D> & Promise<EasyUseAxiosReturn<T, R, D>>;
93
93
 
94
- export { EasyUseAxiosReturn, StrictUseAxiosReturn, UseAxiosOptions, UseAxiosReturn, useAxios };
94
+ export { type EasyUseAxiosReturn, type StrictUseAxiosReturn, type UseAxiosOptions, type UseAxiosReturn, useAxios };
package/useAxios.iife.js CHANGED
@@ -117,25 +117,6 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
117
117
  ;(function (exports, vueDemi, shared, axios) {
118
118
  'use strict';
119
119
 
120
- var __defProp = Object.defineProperty;
121
- var __defProps = Object.defineProperties;
122
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
123
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
124
- var __hasOwnProp = Object.prototype.hasOwnProperty;
125
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
126
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
127
- var __spreadValues = (a, b) => {
128
- for (var prop in b || (b = {}))
129
- if (__hasOwnProp.call(b, prop))
130
- __defNormalProp(a, prop, b[prop]);
131
- if (__getOwnPropSymbols)
132
- for (var prop of __getOwnPropSymbols(b)) {
133
- if (__propIsEnum.call(b, prop))
134
- __defNormalProp(a, prop, b[prop]);
135
- }
136
- return a;
137
- };
138
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
139
120
  function useAxios(...args) {
140
121
  const url = typeof args[0] === "string" ? args[0] : void 0;
141
122
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
@@ -145,7 +126,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
145
126
  immediate: !!argsPlaceholder,
146
127
  shallow: true
147
128
  };
148
- const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
129
+ const isAxiosInstance = (val) => !!val?.request;
149
130
  if (args.length > 0 + argsPlaceholder) {
150
131
  if (isAxiosInstance(args[0 + argsPlaceholder]))
151
132
  instance = args[0 + argsPlaceholder];
@@ -201,7 +182,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
201
182
  let executeCounter = 0;
202
183
  const execute = (executeUrl = url, config = {}) => {
203
184
  error.value = void 0;
204
- const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
185
+ const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
205
186
  if (_url === void 0) {
206
187
  error.value = new axios.AxiosError(axios.AxiosError.ERR_INVALID_URL);
207
188
  isFinished.value = true;
@@ -212,7 +193,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
212
193
  loading(true);
213
194
  executeCounter += 1;
214
195
  const currentExecuteCounter = executeCounter;
215
- instance(_url, __spreadProps(__spreadValues(__spreadValues({}, defaultConfig), typeof executeUrl === "object" ? executeUrl : config), { cancelToken: cancelToken.token })).then((r) => {
196
+ instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, cancelToken: cancelToken.token }).then((r) => {
216
197
  response.value = r;
217
198
  const result2 = r.data;
218
199
  data.value = result2;
@@ -221,8 +202,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
221
202
  error.value = e;
222
203
  onError(e);
223
204
  }).finally(() => {
224
- var _a;
225
- (_a = options.onFinish) == null ? void 0 : _a.call(options);
205
+ options.onFinish?.();
226
206
  if (currentExecuteCounter === executeCounter)
227
207
  loading(false);
228
208
  });
@@ -242,7 +222,10 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
242
222
  abort,
243
223
  execute
244
224
  };
245
- return __spreadValues(__spreadValues({}, result), promise);
225
+ return {
226
+ ...result,
227
+ ...promise
228
+ };
246
229
  }
247
230
 
248
231
  exports.useAxios = useAxios;
@@ -1 +1 @@
1
- var VueDemi=function(e,n,v){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let i=function(c,u){var f,y={},w={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(a,p){return y[a]=p,this},directive:function(a,p){return p?(n.directive(a,p),w):n.directive(a)},mount:function(a,p){return f||(f=new n(Object.assign({propsData:u},c,{provide:Object.assign(y,c.provide)})),f.$mount(a,p),f)},unmount:function(){f&&(f.$destroy(),f=void 0)}};return w};var S=i;for(var l in n)e[l]=n[l];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=i}else if(n.version.slice(0,2)==="2.")if(v){for(var l in v)e[l]=v[l];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var l in n)e[l]=n[l];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(i,c,u){return Array.isArray(i)?(i.length=Math.max(i.length,c),i.splice(c,1,u),u):(i[c]=u,u)},e.del=function(i,c){if(Array.isArray(i)){i.splice(c,1);return}delete i[c]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,v,l){"use strict";var S=Object.defineProperty,i=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,w=(t,r,o)=>r in t?S(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,a=(t,r)=>{for(var o in r||(r={}))f.call(r,o)&&w(t,o,r[o]);if(u)for(var o of u(r))y.call(r,o)&&w(t,o,r[o]);return t},p=(t,r)=>i(t,c(r));function z(...t){const r=typeof t[0]=="string"?t[0]:void 0,o=typeof r=="string"?1:0;let T={},A=l,b={immediate:!!o,shallow:!0};const I=s=>!!s?.request;t.length>0+o&&(I(t[0+o])?A=t[0+o]:T=t[0+o]),t.length>1+o&&I(t[1+o])&&(A=t[1+o]),(t.length===2+o&&!I(t[1+o])||t.length===3+o)&&(b=t[t.length-1]);const{initialData:F,shallow:G,onSuccess:H=v.noop,onError:J=v.noop,immediate:K,resetOnExecute:Q=!1}=b,L=n.shallowRef(),C=(G?n.shallowRef:n.ref)(F),h=n.ref(!1),P=n.ref(!1),j=n.ref(!1),_=n.shallowRef(),N=l.CancelToken.source;let x=N();const E=s=>{h.value||!P.value||(x.cancel(s),x=N(),j.value=!0,P.value=!1,h.value=!1)},U=s=>{P.value=s,h.value=!s},W=()=>{Q&&(C.value=F)},$=()=>new Promise((s,O)=>{v.until(h).toBe(!0).then(()=>_.value?O(_.value):s(q))}),R={then:(...s)=>$().then(...s),catch:(...s)=>$().catch(...s)};let g=0;const k=(s=r,O={})=>{_.value=void 0;const B=typeof s=="string"?s:r??O.url;if(B===void 0)return _.value=new l.AxiosError(l.AxiosError.ERR_INVALID_URL),h.value=!0,R;W(),E(),U(!0),g+=1;const X=g;return A(B,p(a(a({},T),typeof s=="object"?s:O),{cancelToken:x.token})).then(d=>{L.value=d;const M=d.data;C.value=M,H(M)}).catch(d=>{_.value=d,J(d)}).finally(()=>{var d;(d=b.onFinish)==null||d.call(b),X===g&&U(!1)}),R};K&&r&&k();const q={response:L,data:C,error:_,isFinished:h,isLoading:P,cancel:E,isAborted:j,isCanceled:j,abort:E,execute:k};return a(a({},q),R)}e.useAxios=z})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
1
+ var VueDemi=function(e,n,a){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let t=function(i,o){var l,u={},d={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(c,f){return u[c]=f,this},directive:function(c,f){return f?(n.directive(c,f),d):n.directive(c)},mount:function(c,f){return l||(l=new n(Object.assign({propsData:o},i,{provide:Object.assign(u,i.provide)})),l.$mount(c,f),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return d};var R=t;for(var r in n)e[r]=n[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=t}else if(n.version.slice(0,2)==="2.")if(a){for(var r in a)e[r]=a[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var r in n)e[r]=n[r];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(t,i,o){return Array.isArray(t)?(t.length=Math.max(t.length,i),t.splice(i,1,o),o):(t[i]=o,o)},e.del=function(t,i){if(Array.isArray(t)){t.splice(i,1);return}delete t[i]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,a,r){"use strict";function R(...t){const i=typeof t[0]=="string"?t[0]:void 0,o=typeof i=="string"?1:0;let l={},u=r,d={immediate:!!o,shallow:!0};const c=s=>!!s?.request;t.length>0+o&&(c(t[0+o])?u=t[0+o]:l=t[0+o]),t.length>1+o&&c(t[1+o])&&(u=t[1+o]),(t.length===2+o&&!c(t[1+o])||t.length===3+o)&&(d=t[t.length-1]);const{initialData:f,shallow:S,onSuccess:U=a.noop,onError:$=a.noop,immediate:q,resetOnExecute:B=!1}=d,j=n.shallowRef(),w=(S?n.shallowRef:n.ref)(f),v=n.ref(!1),A=n.ref(!1),y=n.ref(!1),p=n.shallowRef(),P=r.CancelToken.source;let C=P();const x=s=>{v.value||!A.value||(C.cancel(s),C=P(),y.value=!0,A.value=!1,v.value=!1)},T=s=>{A.value=s,v.value=!s},M=()=>{B&&(w.value=f)},k=()=>new Promise((s,b)=>{a.until(v).toBe(!0).then(()=>p.value?b(p.value):s(L))}),I={then:(...s)=>k().then(...s),catch:(...s)=>k().catch(...s)};let E=0;const F=(s=i,b={})=>{p.value=void 0;const O=typeof s=="string"?s:i??b.url;if(O===void 0)return p.value=new r.AxiosError(r.AxiosError.ERR_INVALID_URL),v.value=!0,I;M(),x(),T(!0),E+=1;const N=E;return u(O,{...l,...typeof s=="object"?s:b,cancelToken:C.token}).then(h=>{j.value=h;const _=h.data;w.value=_,U(_)}).catch(h=>{p.value=h,$(h)}).finally(()=>{d.onFinish?.(),N===E&&T(!1)}),I};q&&i&&F();const L={response:j,data:w,error:p,isFinished:v,isLoading:A,cancel:x,isAborted:y,isCanceled:y,abort:x,execute:F};return{...L,...I}}e.useAxios=R})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
package/useAxios.mjs CHANGED
@@ -2,25 +2,6 @@ import { shallowRef, ref } from 'vue-demi';
2
2
  import { noop, until } from '@vueuse/shared';
3
3
  import axios, { AxiosError } from 'axios';
4
4
 
5
- var __defProp = Object.defineProperty;
6
- var __defProps = Object.defineProperties;
7
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
5
  function useAxios(...args) {
25
6
  const url = typeof args[0] === "string" ? args[0] : void 0;
26
7
  const argsPlaceholder = typeof url === "string" ? 1 : 0;
@@ -30,7 +11,7 @@ function useAxios(...args) {
30
11
  immediate: !!argsPlaceholder,
31
12
  shallow: true
32
13
  };
33
- const isAxiosInstance = (val) => !!(val == null ? void 0 : val.request);
14
+ const isAxiosInstance = (val) => !!val?.request;
34
15
  if (args.length > 0 + argsPlaceholder) {
35
16
  if (isAxiosInstance(args[0 + argsPlaceholder]))
36
17
  instance = args[0 + argsPlaceholder];
@@ -86,7 +67,7 @@ function useAxios(...args) {
86
67
  let executeCounter = 0;
87
68
  const execute = (executeUrl = url, config = {}) => {
88
69
  error.value = void 0;
89
- const _url = typeof executeUrl === "string" ? executeUrl : url != null ? url : config.url;
70
+ const _url = typeof executeUrl === "string" ? executeUrl : url ?? config.url;
90
71
  if (_url === void 0) {
91
72
  error.value = new AxiosError(AxiosError.ERR_INVALID_URL);
92
73
  isFinished.value = true;
@@ -97,7 +78,7 @@ function useAxios(...args) {
97
78
  loading(true);
98
79
  executeCounter += 1;
99
80
  const currentExecuteCounter = executeCounter;
100
- instance(_url, __spreadProps(__spreadValues(__spreadValues({}, defaultConfig), typeof executeUrl === "object" ? executeUrl : config), { cancelToken: cancelToken.token })).then((r) => {
81
+ instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, cancelToken: cancelToken.token }).then((r) => {
101
82
  response.value = r;
102
83
  const result2 = r.data;
103
84
  data.value = result2;
@@ -106,8 +87,7 @@ function useAxios(...args) {
106
87
  error.value = e;
107
88
  onError(e);
108
89
  }).finally(() => {
109
- var _a;
110
- (_a = options.onFinish) == null ? void 0 : _a.call(options);
90
+ options.onFinish?.();
111
91
  if (currentExecuteCounter === executeCounter)
112
92
  loading(false);
113
93
  });
@@ -127,7 +107,10 @@ function useAxios(...args) {
127
107
  abort,
128
108
  execute
129
109
  };
130
- return __spreadValues(__spreadValues({}, result), promise);
110
+ return {
111
+ ...result,
112
+ ...promise
113
+ };
131
114
  }
132
115
 
133
116
  export { useAxios };
@@ -14,23 +14,11 @@ declare const changeCase_pathCase: typeof pathCase;
14
14
  declare const changeCase_sentenceCase: typeof sentenceCase;
15
15
  declare const changeCase_snakeCase: typeof snakeCase;
16
16
  declare namespace changeCase {
17
- export {
18
- changeCase_camelCase as camelCase,
19
- changeCase_capitalCase as capitalCase,
20
- changeCase_constantCase as constantCase,
21
- changeCase_dotCase as dotCase,
22
- changeCase_headerCase as headerCase,
23
- changeCase_noCase as noCase,
24
- changeCase_paramCase as paramCase,
25
- changeCase_pascalCase as pascalCase,
26
- changeCase_pathCase as pathCase,
27
- changeCase_sentenceCase as sentenceCase,
28
- changeCase_snakeCase as snakeCase,
29
- };
17
+ export { changeCase_camelCase as camelCase, changeCase_capitalCase as capitalCase, changeCase_constantCase as constantCase, changeCase_dotCase as dotCase, changeCase_headerCase as headerCase, changeCase_noCase as noCase, changeCase_paramCase as paramCase, changeCase_pascalCase as pascalCase, changeCase_pathCase as pathCase, changeCase_sentenceCase as sentenceCase, changeCase_snakeCase as snakeCase };
30
18
  }
31
19
 
32
20
  type ChangeCaseType = keyof typeof changeCase;
33
21
  declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
34
22
  declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCaseType, options?: Options | undefined): ComputedRef<string>;
35
23
 
36
- export { ChangeCaseType, useChangeCase };
24
+ export { type ChangeCaseType, useChangeCase };
@@ -14,23 +14,11 @@ declare const changeCase_pathCase: typeof pathCase;
14
14
  declare const changeCase_sentenceCase: typeof sentenceCase;
15
15
  declare const changeCase_snakeCase: typeof snakeCase;
16
16
  declare namespace changeCase {
17
- export {
18
- changeCase_camelCase as camelCase,
19
- changeCase_capitalCase as capitalCase,
20
- changeCase_constantCase as constantCase,
21
- changeCase_dotCase as dotCase,
22
- changeCase_headerCase as headerCase,
23
- changeCase_noCase as noCase,
24
- changeCase_paramCase as paramCase,
25
- changeCase_pascalCase as pascalCase,
26
- changeCase_pathCase as pathCase,
27
- changeCase_sentenceCase as sentenceCase,
28
- changeCase_snakeCase as snakeCase,
29
- };
17
+ export { changeCase_camelCase as camelCase, changeCase_capitalCase as capitalCase, changeCase_constantCase as constantCase, changeCase_dotCase as dotCase, changeCase_headerCase as headerCase, changeCase_noCase as noCase, changeCase_paramCase as paramCase, changeCase_pascalCase as pascalCase, changeCase_pathCase as pathCase, changeCase_sentenceCase as sentenceCase, changeCase_snakeCase as snakeCase };
30
18
  }
31
19
 
32
20
  type ChangeCaseType = keyof typeof changeCase;
33
21
  declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
34
22
  declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCaseType, options?: Options | undefined): ComputedRef<string>;
35
23
 
36
- export { ChangeCaseType, useChangeCase };
24
+ export { type ChangeCaseType, useChangeCase };
@@ -14,23 +14,11 @@ declare const changeCase_pathCase: typeof pathCase;
14
14
  declare const changeCase_sentenceCase: typeof sentenceCase;
15
15
  declare const changeCase_snakeCase: typeof snakeCase;
16
16
  declare namespace changeCase {
17
- export {
18
- changeCase_camelCase as camelCase,
19
- changeCase_capitalCase as capitalCase,
20
- changeCase_constantCase as constantCase,
21
- changeCase_dotCase as dotCase,
22
- changeCase_headerCase as headerCase,
23
- changeCase_noCase as noCase,
24
- changeCase_paramCase as paramCase,
25
- changeCase_pascalCase as pascalCase,
26
- changeCase_pathCase as pathCase,
27
- changeCase_sentenceCase as sentenceCase,
28
- changeCase_snakeCase as snakeCase,
29
- };
17
+ export { changeCase_camelCase as camelCase, changeCase_capitalCase as capitalCase, changeCase_constantCase as constantCase, changeCase_dotCase as dotCase, changeCase_headerCase as headerCase, changeCase_noCase as noCase, changeCase_paramCase as paramCase, changeCase_pascalCase as pascalCase, changeCase_pathCase as pathCase, changeCase_sentenceCase as sentenceCase, changeCase_snakeCase as snakeCase };
30
18
  }
31
19
 
32
20
  type ChangeCaseType = keyof typeof changeCase;
33
21
  declare function useChangeCase(input: MaybeRef<string>, type: ChangeCaseType, options?: Options | undefined): WritableComputedRef<string>;
34
22
  declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCaseType, options?: Options | undefined): ComputedRef<string>;
35
23
 
36
- export { ChangeCaseType, useChangeCase };
24
+ export { type ChangeCaseType, useChangeCase };
package/useCookies.cjs CHANGED
@@ -4,22 +4,6 @@ var shared = require('@vueuse/shared');
4
4
  var vueDemi = require('vue-demi');
5
5
  var Cookie = require('universal-cookie');
6
6
 
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
7
  function createCookies(req) {
24
8
  const universalCookie = new Cookie(req ? req.headers.cookie : null);
25
9
  return (dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}) => useCookies(dependencies, { doNotParse, autoUpdateDependencies }, universalCookie);
@@ -50,14 +34,14 @@ function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies =
50
34
  if (autoUpdateDependencies && watchingDependencies && !watchingDependencies.includes(args[0]))
51
35
  watchingDependencies.push(args[0]);
52
36
  touches.value;
53
- return cookies.get(args[0], __spreadValues({ doNotParse }, args[1]));
37
+ return cookies.get(args[0], { doNotParse, ...args[1] });
54
38
  },
55
39
  /**
56
40
  * Reactive get all cookies
57
41
  */
58
42
  getAll: (...args) => {
59
43
  touches.value;
60
- return cookies.getAll(__spreadValues({ doNotParse }, args[0]));
44
+ return cookies.getAll({ doNotParse, ...args[0] });
61
45
  },
62
46
  set: (...args) => cookies.set(...args),
63
47
  remove: (...args) => cookies.remove(...args),