@vueuse/firebase 10.4.0 → 10.5.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.
package/index.cjs CHANGED
@@ -26,7 +26,8 @@ function getData(docRef) {
26
26
  return data;
27
27
  }
28
28
  function isDocumentReference(docRef) {
29
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
29
+ var _a;
30
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
30
31
  }
31
32
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
32
33
  const {
package/index.iife.js CHANGED
@@ -138,7 +138,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
138
138
  return data;
139
139
  }
140
140
  function isDocumentReference(docRef) {
141
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
141
+ var _a;
142
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
142
143
  }
143
144
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
144
145
  const {
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(n,e,u){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let o=function(s,a){var c,b={},r={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(t,i){return b[t]=i,this},directive:function(t,i){return i?(e.directive(t,i),r):e.directive(t)},mount:function(t,i){return c||(c=new e(Object.assign({propsData:a},s,{provide:Object.assign(b,s.provide)})),c.$mount(t,i),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return r};var g=o;for(var f in e)n[f]=e[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(e.version.slice(0,2)==="2.")if(u){for(var f in u)n[f]=u[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.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(e.version.slice(0,2)==="3."){for(var f in e)n[f]=e[f];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(o,s,a){return Array.isArray(o)?(o.length=Math.max(o.length,s),o.splice(s,1,a),a):(o[s]=a,a)},n.del=function(o,s){if(Array.isArray(o)){o.splice(s,1);return}delete o[s]}}else console.error("[vue-demi] Vue version "+e.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,e,u,f,g){"use strict";function o(r){const t=e.ref(r.currentUser),i=e.computed(()=>!!t.value);return r.onIdTokenChanged(p=>t.value=p),{isAuthenticated:i,user:t}}function s(r){const t=r.data();return t&&Object.defineProperty(t,"id",{value:r.id.toString(),writable:!1}),t}function a(r){return(r.path?.match(/\//g)||[]).length%2!==0}function c(r,t=void 0,i={}){const{errorHandler:p=A=>console.error(A),autoDispose:v=!0}=i,h=e.isRef(r)?r:e.computed(()=>r);let d=()=>{};const l=e.ref(t);return e.watch(h,A=>{d(),h.value?a(h.value)?d=f.onSnapshot(A,y=>{l.value=s(y)||null},p):d=f.onSnapshot(A,y=>{l.value=y.docs.map(s).filter(u.isDef)},p):l.value=t},{immediate:!0}),v===!0?u.tryOnScopeDispose(()=>{d()}):typeof v=="number"&&u.tryOnScopeDispose(()=>{u.useTimeoutFn(()=>{d()},v)}),l}function b(r,t={}){const{errorHandler:i=l=>console.error(l),autoDispose:p=!0}=t,v=e.ref(void 0);function h(l){v.value=l.val()}const d=g.onValue(r,h,i);return p&&u.tryOnScopeDispose(()=>d()),v}n.useAuth=o,n.useFirestore=c,n.useRTDB=b})(this.VueUse=this.VueUse||{},VueDemi,VueUse,firebase,firebase);
1
+ var VueDemi=function(n,e,u){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let o=function(s,a){var c,b={},r={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(t,i){return b[t]=i,this},directive:function(t,i){return i?(e.directive(t,i),r):e.directive(t)},mount:function(t,i){return c||(c=new e(Object.assign({propsData:a},s,{provide:Object.assign(b,s.provide)})),c.$mount(t,i),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return r};var g=o;for(var f in e)n[f]=e[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(e.version.slice(0,2)==="2.")if(u){for(var f in u)n[f]=u[f];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.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(e.version.slice(0,2)==="3."){for(var f in e)n[f]=e[f];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(o,s,a){return Array.isArray(o)?(o.length=Math.max(o.length,s),o.splice(s,1,a),a):(o[s]=a,a)},n.del=function(o,s){if(Array.isArray(o)){o.splice(s,1);return}delete o[s]}}else console.error("[vue-demi] Vue version "+e.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,e,u,f,g){"use strict";function o(r){const t=e.ref(r.currentUser),i=e.computed(()=>!!t.value);return r.onIdTokenChanged(p=>t.value=p),{isAuthenticated:i,user:t}}function s(r){const t=r.data();return t&&Object.defineProperty(t,"id",{value:r.id.toString(),writable:!1}),t}function a(r){var t;return(((t=r.path)==null?void 0:t.match(/\//g))||[]).length%2!==0}function c(r,t=void 0,i={}){const{errorHandler:p=A=>console.error(A),autoDispose:v=!0}=i,h=e.isRef(r)?r:e.computed(()=>r);let d=()=>{};const l=e.ref(t);return e.watch(h,A=>{d(),h.value?a(h.value)?d=f.onSnapshot(A,y=>{l.value=s(y)||null},p):d=f.onSnapshot(A,y=>{l.value=y.docs.map(s).filter(u.isDef)},p):l.value=t},{immediate:!0}),v===!0?u.tryOnScopeDispose(()=>{d()}):typeof v=="number"&&u.tryOnScopeDispose(()=>{u.useTimeoutFn(()=>{d()},v)}),l}function b(r,t={}){const{errorHandler:i=l=>console.error(l),autoDispose:p=!0}=t,v=e.ref(void 0);function h(l){v.value=l.val()}const d=g.onValue(r,h,i);return p&&u.tryOnScopeDispose(()=>d()),v}n.useAuth=o,n.useFirestore=c,n.useRTDB=b})(this.VueUse=this.VueUse||{},VueDemi,VueUse,firebase,firebase);
package/index.mjs CHANGED
@@ -24,7 +24,8 @@ function getData(docRef) {
24
24
  return data;
25
25
  }
26
26
  function isDocumentReference(docRef) {
27
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
27
+ var _a;
28
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
28
29
  }
29
30
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
30
31
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/firebase",
3
- "version": "10.4.0",
3
+ "version": "10.5.0",
4
4
  "description": "Enables realtime bindings for Firebase",
5
5
  "author": "Anthony Fu <https://github.com/antfu>",
6
6
  "license": "MIT",
@@ -29,16 +29,16 @@
29
29
  },
30
30
  "./*": "./*",
31
31
  "./useAuth": {
32
- "require": "./useAuth.cjs",
33
- "import": "./useAuth.mjs"
32
+ "import": "./useAuth.mjs",
33
+ "require": "./useAuth.cjs"
34
34
  },
35
35
  "./useFirestore": {
36
- "require": "./useFirestore.cjs",
37
- "import": "./useFirestore.mjs"
36
+ "import": "./useFirestore.mjs",
37
+ "require": "./useFirestore.cjs"
38
38
  },
39
39
  "./useRTDB": {
40
- "require": "./useRTDB.cjs",
41
- "import": "./useRTDB.mjs"
40
+ "import": "./useRTDB.mjs",
41
+ "require": "./useRTDB.cjs"
42
42
  }
43
43
  },
44
44
  "main": "./index.cjs",
@@ -50,7 +50,7 @@
50
50
  "firebase": ">=9.0.0"
51
51
  },
52
52
  "dependencies": {
53
- "@vueuse/shared": "10.4.0",
54
- "vue-demi": ">=0.14.5"
53
+ "@vueuse/shared": "10.5.0",
54
+ "vue-demi": ">=0.14.6"
55
55
  }
56
56
  }
package/useFirestore.cjs CHANGED
@@ -15,7 +15,8 @@ function getData(docRef) {
15
15
  return data;
16
16
  }
17
17
  function isDocumentReference(docRef) {
18
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
18
+ var _a;
19
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
19
20
  }
20
21
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
21
22
  const {
@@ -128,7 +128,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
128
128
  return data;
129
129
  }
130
130
  function isDocumentReference(docRef) {
131
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
131
+ var _a;
132
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
132
133
  }
133
134
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
134
135
  const {
@@ -1 +1 @@
1
- var VueDemi=function(n,e,a){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let o=function(s,t){var r,d={},l={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(f,c){return d[f]=c,this},directive:function(f,c){return c?(e.directive(f,c),l):e.directive(f)},mount:function(f,c){return r||(r=new e(Object.assign({propsData:t},s,{provide:Object.assign(d,s.provide)})),r.$mount(f,c),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}};return l};var h=o;for(var i in e)n[i]=e[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(e.version.slice(0,2)==="2.")if(a){for(var i in a)n[i]=a[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.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(e.version.slice(0,2)==="3."){for(var i in e)n[i]=e[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(o,s,t){return Array.isArray(o)?(o.length=Math.max(o.length,s),o.splice(s,1,t),t):(o[s]=t,t)},n.del=function(o,s){if(Array.isArray(o)){o.splice(s,1);return}delete o[s]}}else console.error("[vue-demi] Vue version "+e.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,e,a,i){"use strict";function h(t){const r=t.data();return r&&Object.defineProperty(r,"id",{value:t.id.toString(),writable:!1}),r}function o(t){return(t.path?.match(/\//g)||[]).length%2!==0}function s(t,r=void 0,d={}){const{errorHandler:l=v=>console.error(v),autoDispose:f=!0}=d,c=e.isRef(t)?t:e.computed(()=>t);let u=()=>{};const p=e.ref(r);return e.watch(c,v=>{u(),c.value?o(c.value)?u=i.onSnapshot(v,b=>{p.value=h(b)||null},l):u=i.onSnapshot(v,b=>{p.value=b.docs.map(h).filter(a.isDef)},l):p.value=r},{immediate:!0}),f===!0?a.tryOnScopeDispose(()=>{u()}):typeof f=="number"&&a.tryOnScopeDispose(()=>{a.useTimeoutFn(()=>{u()},f)}),p}n.useFirestore=s})(this.VueUse=this.VueUse||{},VueDemi,VueUse,firebase);
1
+ var VueDemi=function(n,e,a){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let o=function(s,t){var r,d={},l={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(f,c){return d[f]=c,this},directive:function(f,c){return c?(e.directive(f,c),l):e.directive(f)},mount:function(f,c){return r||(r=new e(Object.assign({propsData:t},s,{provide:Object.assign(d,s.provide)})),r.$mount(f,c),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}};return l};var h=o;for(var i in e)n[i]=e[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=o}else if(e.version.slice(0,2)==="2.")if(a){for(var i in a)n[i]=a[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.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(e.version.slice(0,2)==="3."){for(var i in e)n[i]=e[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(o,s,t){return Array.isArray(o)?(o.length=Math.max(o.length,s),o.splice(s,1,t),t):(o[s]=t,t)},n.del=function(o,s){if(Array.isArray(o)){o.splice(s,1);return}delete o[s]}}else console.error("[vue-demi] Vue version "+e.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,e,a,i){"use strict";function h(t){const r=t.data();return r&&Object.defineProperty(r,"id",{value:t.id.toString(),writable:!1}),r}function o(t){var r;return(((r=t.path)==null?void 0:r.match(/\//g))||[]).length%2!==0}function s(t,r=void 0,d={}){const{errorHandler:l=v=>console.error(v),autoDispose:f=!0}=d,c=e.isRef(t)?t:e.computed(()=>t);let u=()=>{};const p=e.ref(r);return e.watch(c,v=>{u(),c.value?o(c.value)?u=i.onSnapshot(v,b=>{p.value=h(b)||null},l):u=i.onSnapshot(v,b=>{p.value=b.docs.map(h).filter(a.isDef)},l):p.value=r},{immediate:!0}),f===!0?a.tryOnScopeDispose(()=>{u()}):typeof f=="number"&&a.tryOnScopeDispose(()=>{a.useTimeoutFn(()=>{u()},f)}),p}n.useFirestore=s})(this.VueUse=this.VueUse||{},VueDemi,VueUse,firebase);
package/useFirestore.mjs CHANGED
@@ -13,7 +13,8 @@ function getData(docRef) {
13
13
  return data;
14
14
  }
15
15
  function isDocumentReference(docRef) {
16
- return (docRef.path?.match(/\//g) || []).length % 2 !== 0;
16
+ var _a;
17
+ return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
17
18
  }
18
19
  function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
19
20
  const {