tinybase 2.1.0 → 2.1.1

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 (52) hide show
  1. package/lib/debug/store.js +2 -1
  2. package/lib/debug/tinybase.js +2 -1
  3. package/lib/es6/store.js +1 -1
  4. package/lib/es6/store.js.gz +0 -0
  5. package/lib/es6/tinybase.js +1 -1
  6. package/lib/es6/tinybase.js.gz +0 -0
  7. package/lib/store.js +1 -1
  8. package/lib/store.js.gz +0 -0
  9. package/lib/tinybase.js +1 -1
  10. package/lib/tinybase.js.gz +0 -0
  11. package/lib/umd/checkpoints.js +1 -1
  12. package/lib/umd/checkpoints.js.gz +0 -0
  13. package/lib/umd/common.js +1 -1
  14. package/lib/umd/common.js.gz +0 -0
  15. package/lib/umd/indexes.js +1 -1
  16. package/lib/umd/indexes.js.gz +0 -0
  17. package/lib/umd/metrics.js +1 -1
  18. package/lib/umd/metrics.js.gz +0 -0
  19. package/lib/umd/persisters.js +1 -1
  20. package/lib/umd/persisters.js.gz +0 -0
  21. package/lib/umd/queries.js +1 -1
  22. package/lib/umd/queries.js.gz +0 -0
  23. package/lib/umd/relationships.js +1 -1
  24. package/lib/umd/relationships.js.gz +0 -0
  25. package/lib/umd/store.js +1 -1
  26. package/lib/umd/store.js.gz +0 -0
  27. package/lib/umd/tinybase.js +1 -1
  28. package/lib/umd/tinybase.js.gz +0 -0
  29. package/lib/umd/ui-react.js +1 -1
  30. package/lib/umd/ui-react.js.gz +0 -0
  31. package/lib/umd-es6/checkpoints.js +1 -1
  32. package/lib/umd-es6/checkpoints.js.gz +0 -0
  33. package/lib/umd-es6/common.js +1 -1
  34. package/lib/umd-es6/common.js.gz +0 -0
  35. package/lib/umd-es6/indexes.js +1 -1
  36. package/lib/umd-es6/indexes.js.gz +0 -0
  37. package/lib/umd-es6/metrics.js +1 -1
  38. package/lib/umd-es6/metrics.js.gz +0 -0
  39. package/lib/umd-es6/persisters.js +1 -1
  40. package/lib/umd-es6/persisters.js.gz +0 -0
  41. package/lib/umd-es6/queries.js +1 -1
  42. package/lib/umd-es6/queries.js.gz +0 -0
  43. package/lib/umd-es6/relationships.js +1 -1
  44. package/lib/umd-es6/relationships.js.gz +0 -0
  45. package/lib/umd-es6/store.js +1 -1
  46. package/lib/umd-es6/store.js.gz +0 -0
  47. package/lib/umd-es6/tinybase.js +1 -1
  48. package/lib/umd-es6/tinybase.js.gz +0 -0
  49. package/lib/umd-es6/ui-react.js +1 -1
  50. package/lib/umd-es6/ui-react.js.gz +0 -0
  51. package/package.json +23 -23
  52. package/readme.md +1 -1
@@ -1 +1 @@
1
- var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,o="",l=t(o),r="Tables",n="TableIds",d="Table",u="RowIds",i="SortedRowIds",a="Row",c="CellIds",I="Cell",w=(e,s)=>e.map(s),R=e=>null==e,p=(e,s,t)=>R(e)?null==t?void 0:t():s(e),b=()=>{},{createContext:C,useContext:k}=s,v=C([]),g=(e,s)=>{const t=k(v);return R(e)?t[s]:((e,s)=>p(e,(e=>e[s])))(t[s+1],e)},m=(e,s)=>{const o=g(e,s);return R(e)||(e=>t(e)==l)(e)?o:e},y=e=>m(e,0),h=e=>m(e,2),f=e=>m(e,4),L=e=>m(e,6),S=e=>m(e,8),T=e=>m(e,10),{useCallback:P,useEffect:x,useMemo:V,useRef:q,useState:O}=s,B=(e,s,t=[])=>{const o=V((()=>s(e)),[e,...t]);return x((()=>()=>o.destroy()),[o]),o},M=(e,s,t,o=[],l)=>{const[,r]=O(),n=P((()=>{var l,r;return null!=(r=null==(l=null==s?void 0:s["get"+e])?void 0:l.call(s,...o))?r:t}),[s,...o]),[d]=O(n),u=q(d);return V((()=>u.current=n()),[n]),j(e,s,((...e)=>{u.current=R(l)?n():e[l],r([])}),[],o),u.current},j=(e,s,t,o=[],l=[],...r)=>x((()=>{var o;const n=null==(o=null==s?void 0:s["add"+e+"Listener"])?void 0:o.call(s,...l,t,...r);return()=>null==s?void 0:s.delListener(n)}),[s,...l,...o,...r]),D=(e,s,t,o=[],l=b,r=[],...n)=>{const d=y(e);return P((e=>p(d,(o=>p(t(e,o),(e=>l(o["set"+s](...n,e),e)))))),[d,s,...o,...r,...n])},A=(e,s,t=b,o=[],...l)=>{const r=y(e);return P((()=>t(null==r?void 0:r["del"+s](...l))),[r,s,...o,...l])},E=(e,s,t)=>{const o=T(e);return P((()=>null==o?void 0:o[s](t)),[o,s,t])},F=e=>M(n,y(e),[],[]),G=(e,s)=>M(u,y(s),[],[e]),Q=(e,s,t,o=0,l,r)=>M(i,y(r),[],[e,s,t,o,l],6),U=(e,s,t)=>M(c,y(t),[],[e,s]),_=(e,s,t,o)=>M(I,y(o),void 0,[e,s,t],4),z=(e,s)=>M("Metric",h(s),void 0,[e]),H=(e,s)=>M("SliceIds",f(s),[],[e]),J=(e,s,t)=>M("SliceRowIds",f(t),[],[e,s]),K=(e,s,t)=>M("RemoteRowId",L(t),void 0,[e,s]),N=(e,s,t)=>M("LocalRowIds",L(t),[],[e,s]),W=(e,s,t)=>M("LinkedRowIds",L(t),[],[e,s]),X=(e,s)=>M("ResultRowIds",S(s),[],[e]),Y=(e,s,t,o=0,l,r)=>M("ResultSortedRowIds",S(r),[],[e,s,t,o,l],6),Z=(e,s,t)=>M("ResultCellIds",S(t),[],[e,s]),$=(e,s,t,o)=>M("ResultCell",S(o),void 0,[e,s,t]),ee=e=>M("CheckpointIds",T(e),[[],void 0,[]]),se=(e,s)=>M("Checkpoint",T(s),void 0,[e]),te=e=>E(e,"goBackward"),oe=e=>E(e,"goForward");var le=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,ae=(e,s,t)=>s in e?le(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ce=(e,s)=>{for(var t in s||(s={}))ue.call(s,t)&&ae(e,t,s[t]);if(de)for(var t of de(s))ie.call(s,t)&&ae(e,t,s[t]);return e},Ie=(e,s)=>re(e,ne(s)),we=(e,s)=>{var t={};for(var o in e)ue.call(e,o)&&s.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&de)for(var o of de(e))s.indexOf(o)<0&&ie.call(e,o)&&(t[o]=e[o]);return t};const{createElement:Re,useMemo:pe}=s,be=({tableId:e,store:s,rowComponent:t=fe,getRowComponentProps:o,separator:l,debugIds:r},n)=>ye(w(n,(l=>Re(t,Ie(ce({},me(o,l)),{key:l,tableId:e,rowId:l,store:s,debugIds:r})))),l,r,e),Ce=({queryId:e,queries:s,resultRowComponent:t=Pe,getResultRowComponentProps:o,separator:l,debugIds:r},n)=>ye(w(n,(l=>Re(t,Ie(ce({},me(o,l)),{key:l,queryId:e,rowId:l,queries:s,debugIds:r})))),l,r,e),ke=e=>{const s=L(e);return[s,null==s?void 0:s.getStore()]},ve=({relationshipId:e,relationships:s,rowComponent:t=fe,getRowComponentProps:o,separator:l,debugIds:r},n,d)=>{const[u,i]=ke(s),a=null==u?void 0:u.getLocalTableId(e),c=n(e,d,u);return ye(w(c,(e=>Re(t,Ie(ce({},me(o,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:r})))),l,r,d)},ge=e=>({checkpoints:s,checkpointComponent:t=xe,getCheckpointComponentProps:o,separator:l,debugIds:r})=>{const n=T(s);return ye(w(e(ee(n)),(e=>Re(t,Ie(ce({},me(o,e)),{key:e,checkpoints:n,checkpointId:e,debugIds:r})))),l)},me=(e,s)=>R(e)?{}:e(s),ye=(e,s,t,o)=>{const l=R(s)||!Array.isArray(e)?e:w(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",l,"}"]:l},he=({tableId:e,rowId:s,cellId:t,store:l,debugIds:r})=>{var n;return ye(o+(null!=(n=_(e,s,t,l))?n:o),void 0,r,t)},fe=({tableId:e,rowId:s,store:t,cellComponent:o=he,getCellComponentProps:l,separator:r,debugIds:n})=>ye(w(U(e,s,t),(r=>Re(o,Ie(ce({},me(l,r)),{key:r,tableId:e,rowId:s,cellId:r,store:t,debugIds:n})))),r,n,s),Le=e=>be(e,G(e.tableId,e.store)),Se=({indexId:e,sliceId:s,indexes:t,rowComponent:o=fe,getRowComponentProps:l,separator:r,debugIds:n})=>{const d=f(t),u=null==d?void 0:d.getStore(),i=null==d?void 0:d.getTableId(e),a=J(e,s,d);return ye(w(a,(e=>Re(o,Ie(ce({},me(l,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:n})))),r,n,s)},Te=({queryId:e,rowId:s,cellId:t,queries:l,debugIds:r})=>{var n;return ye(o+(null!=(n=$(e,s,t,l))?n:o),void 0,r,t)},Pe=({queryId:e,rowId:s,queries:t,resultCellComponent:o=Te,getResultCellComponentProps:l,separator:r,debugIds:n})=>ye(w(Z(e,s,t),(r=>Re(o,Ie(ce({},me(l,r)),{key:r,queryId:e,rowId:s,cellId:r,queries:t,debugIds:n})))),r,n,s),xe=({checkpoints:e,checkpointId:s,debugIds:t})=>{var l;return ye(null!=(l=se(s,e))?l:o,void 0,t,s)},Ve=ge((e=>e[0])),qe=ge((e=>R(e[1])?[]:[e[1]])),Oe=ge((e=>e[2]));e.BackwardCheckpointsView=Ve,e.CellView=he,e.CheckpointView=xe,e.CurrentCheckpointView=qe,e.ForwardCheckpointsView=Oe,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Se,getSliceComponentProps:o,separator:l,debugIds:r})=>ye(w(H(e,s),(l=>Re(t,Ie(ce({},me(o,l)),{key:l,indexId:e,sliceId:l,indexes:s,debugIds:r})))),l,r,e),e.LinkedRowsView=e=>ve(e,W,e.firstRowId),e.LocalRowsView=e=>ve(e,N,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var l;return ye(null!=(l=z(e,s))?l:o,void 0,t,e)},e.Provider=({store:e,storesById:t,metrics:o,metricsById:l,indexes:r,indexesById:n,relationships:d,relationshipsById:u,queries:i,queriesById:a,checkpoints:c,checkpointsById:I,children:w})=>{const R=s.useContext(v);return Re(v.Provider,{value:pe((()=>[null!=e?e:R[0],ce(ce({},R[1]),t),null!=o?o:R[2],ce(ce({},R[3]),l),null!=r?r:R[4],ce(ce({},R[5]),n),null!=d?d:R[6],ce(ce({},R[7]),u),null!=i?i:R[8],ce(ce({},R[9]),a),null!=c?c:R[10],ce(ce({},R[11]),I)]),[e,t,o,l,r,n,d,u,i,a,c,I,R])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=fe,getRowComponentProps:l,debugIds:r})=>{const[n,d]=ke(t),u=null==n?void 0:n.getRemoteTableId(e),i=K(e,s,n);return ye(R(u)||R(i)?null:Re(o,Ie(ce({},me(l,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:r})),void 0,r,s)},e.ResultCellView=Te,e.ResultRowView=Pe,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:o,offset:l,limit:r}=s,n=we(s,["cellId","descending","offset","limit"]);return Ce(n,Y(n.queryId,t,o,l,r,n.queries))},e.ResultTableView=e=>Ce(e,X(e.queryId,e.queries)),e.RowView=fe,e.SliceView=Se,e.SortedTableView=e=>{var s=e,{cellId:t,descending:o,offset:l,limit:r}=s,n=we(s,["cellId","descending","offset","limit"]);return be(n,Q(n.tableId,t,o,l,r,n.store))},e.TableView=Le,e.TablesView=({store:e,tableComponent:s=Le,getTableComponentProps:t,separator:o,debugIds:l})=>ye(w(F(e),(o=>Re(s,Ie(ce({},me(t,o)),{key:o,tableId:o,store:e,debugIds:l})))),o),e.tableView=be,e.useAddRowCallback=(e,s,t=[],o,l=b,r=[])=>{const n=y(o);return P((t=>p(n,(o=>p(s(t,o),(s=>l(o.addRow(e,s),o,s)))))),[n,e,...t,...r])},e.useCell=_,e.useCellIds=U,e.useCellIdsListener=(e,s,t,o,l,r)=>j(c,y(r),t,o,[e,s],l),e.useCellListener=(e,s,t,o,l,r,n)=>j(I,y(n),o,l,[e,s,t],r),e.useCheckpoint=se,e.useCheckpointIds=ee,e.useCheckpointIdsListener=(e,s,t)=>j("CheckpointIds",T(t),e,s),e.useCheckpointListener=(e,s,t,o)=>j("Checkpoint",T(o),s,t,[e]),e.useCheckpoints=e=>g(e,10),e.useCreateCheckpoints=(e,s,t)=>B(e,s,t),e.useCreateIndexes=(e,s,t)=>B(e,s,t),e.useCreateMetrics=(e,s,t)=>B(e,s,t),e.useCreatePersister=(e,s,t=[],o,l=[])=>{const[,r]=O(),n=V((()=>s(e)),[e,...t]);return x((()=>{var e,s,t;return e=void 0,s=null,t=function*(){yield null==o?void 0:o(n),r(1)},new Promise(((o,l)=>{var r=e=>{try{d(t.next(e))}catch(e){l(e)}},n=e=>{try{d(t.throw(e))}catch(e){l(e)}},d=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,n);d((t=t.apply(e,s)).next())})),()=>{n.destroy()}}),[n,...l]),n},e.useCreateQueries=(e,s,t)=>B(e,s,t),e.useCreateRelationships=(e,s,t)=>B(e,s,t),e.useCreateStore=(e,s=[])=>V(e,s),e.useDelCellCallback=(e,s,t,o,l,r,n)=>A(l,I,r,n,e,s,t,o),e.useDelRowCallback=(e,s,t,o,l)=>A(t,a,o,l,e,s),e.useDelTableCallback=(e,s,t,o)=>A(s,d,t,o,e),e.useDelTablesCallback=(e,s,t)=>A(e,r,s,t),e.useGoBackwardCallback=te,e.useGoForwardCallback=oe,e.useGoToCallback=(e,s=[],t,o=b,l=[])=>{const r=T(t);return P((s=>p(r,(t=>p(e(s),(e=>o(t.goTo(e),e)))))),[r,...s,...l])},e.useIndexes=e=>g(e,4),e.useLinkedRowIds=W,e.useLinkedRowIdsListener=(e,s,t,o,l)=>j("LinkedRowIds",L(l),t,o,[e,s]),e.useLocalRowIds=N,e.useLocalRowIdsListener=(e,s,t,o,l)=>j("LocalRowIds",L(l),t,o,[e,s]),e.useMetric=z,e.useMetricListener=(e,s,t,o)=>j("Metric",h(o),s,t,[e]),e.useMetrics=e=>g(e,2),e.useQueries=e=>g(e,8),e.useRedoInformation=e=>{var s;const t=T(e),[,,[l]]=ee(t);return[!R(l),oe(t),l,null!=(s=p(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:o]},e.useRelationships=e=>g(e,6),e.useRemoteRowId=K,e.useRemoteRowIdListener=(e,s,t,o,l)=>j("RemoteRowId",L(l),t,o,[e,s]),e.useResultCell=$,e.useResultCellIds=Z,e.useResultCellIdsListener=(e,s,t,o,l)=>j("ResultCellIds",S(l),t,o,[e,s]),e.useResultCellListener=(e,s,t,o,l,r)=>j("ResultCell",S(r),o,l,[e,s,t]),e.useResultRow=(e,s,t)=>M("ResultRow",S(t),{},[e,s]),e.useResultRowIds=X,e.useResultRowIdsListener=(e,s,t,o)=>j("ResultRowIds",S(o),s,t,[e]),e.useResultRowListener=(e,s,t,o,l)=>j("ResultRow",S(l),t,o,[e,s]),e.useResultSortedRowIds=Y,e.useResultSortedRowIdsListener=(e,s,t,o,l,r,n,d)=>j("ResultSortedRowIds",S(d),r,n,[e,s,t,o,l]),e.useResultTable=(e,s)=>M("ResultTable",S(s),{},[e]),e.useResultTableListener=(e,s,t,o)=>j("ResultTable",S(o),s,t,[e]),e.useRow=(e,s,t)=>M(a,y(t),{},[e,s]),e.useRowIds=G,e.useRowIdsListener=(e,s,t,o,l)=>j(u,y(l),s,t,[e],o),e.useRowListener=(e,s,t,o,l,r)=>j(a,y(r),t,o,[e,s],l),e.useSetCellCallback=(e,s,t,o,l,r,n,d)=>D(r,I,o,l,n,d,e,s,t),e.useSetCheckpointCallback=(e=b,s=[],t,o=b,l=[])=>{const r=T(t);return P((s=>p(r,(t=>{const l=e(s);o(t.addCheckpoint(l),t,l)}))),[r,...s,...l])},e.useSetPartialRowCallback=(e,s,t,o,l,r,n)=>D(l,"PartialRow",t,o,r,n,e,s),e.useSetRowCallback=(e,s,t,o,l,r,n)=>D(l,a,t,o,r,n,e,s),e.useSetTableCallback=(e,s,t,o,l,r)=>D(o,d,s,t,l,r,e),e.useSetTablesCallback=(e,s,t,o,l)=>D(t,r,e,s,o,l),e.useSliceIds=H,e.useSliceIdsListener=(e,s,t,o)=>j("SliceIds",f(o),s,t,[e]),e.useSliceRowIds=J,e.useSliceRowIdsListener=(e,s,t,o,l)=>j("SliceRowIds",f(l),t,o,[e,s]),e.useSortedRowIds=Q,e.useSortedRowIdsListener=(e,s,t,o,l,r,n,d,u)=>j(i,y(u),r,n,[e,s,t,o,l],d),e.useStore=e=>g(e,0),e.useTable=(e,s)=>M(d,y(s),{},[e]),e.useTableIds=F,e.useTableIdsListener=(e,s,t,o)=>j(n,y(o),e,s,[],t),e.useTableListener=(e,s,t,o,l)=>j(d,y(l),s,t,[e],o),e.useTables=e=>M(r,y(e),{}),e.useTablesListener=(e,s,t,o)=>j(r,y(o),e,s,[],t),e.useUndoInformation=e=>{var s;const t=T(e),[l,r]=ee(t);return[(n=l,!(0==(e=>e.length)(n))),te(t),r,null!=(s=p(r,(e=>null==t?void 0:t.getCheckpoint(e))))?s:o];var n},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
1
+ var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,o="",l=t(o),r="Tables",n="TableIds",d="Table",u="RowIds",i="SortedRowIds",a="Row",c="CellIds",I="Cell",w=(e,s)=>e.map(s),R=e=>null==e,p=(e,s,t)=>R(e)?null==t?void 0:t():s(e),b=()=>{},{createContext:C,useContext:k}=s,g=C([]),v=(e,s)=>{const t=k(g);return R(e)?t[s]:((e,s)=>p(e,(e=>e[s])))(t[s+1],e)},m=(e,s)=>{const o=v(e,s);return R(e)||(e=>t(e)==l)(e)?o:e},h=e=>m(e,0),y=e=>m(e,2),f=e=>m(e,4),L=e=>m(e,6),S=e=>m(e,8),T=e=>m(e,10),{useCallback:P,useEffect:x,useMemo:V,useRef:q,useState:O}=s,B=(e,s,t=[])=>{const o=V((()=>s(e)),[e,...t]);return x((()=>()=>o.destroy()),[o]),o},M=(e,s,t,o=[],l)=>{const[,r]=O(),n=P((()=>{var l,r;return null!=(r=null==(l=null==s?void 0:s["get"+e])?void 0:l.call(s,...o))?r:t}),[s,...o]),[d]=O(n),u=q(d);return V((()=>u.current=n()),[n]),j(e,s,((...e)=>{u.current=R(l)?n():e[l],r([])}),[],o),u.current},j=(e,s,t,o=[],l=[],...r)=>x((()=>{var o;const n=null==(o=null==s?void 0:s["add"+e+"Listener"])?void 0:o.call(s,...l,t,...r);return()=>null==s?void 0:s.delListener(n)}),[s,...l,...o,...r]),D=(e,s,t,o=[],l=b,r=[],...n)=>{const d=h(e);return P((e=>p(d,(o=>p(t(e,o),(e=>l(o["set"+s](...n,e),e)))))),[d,s,...o,...r,...n])},A=(e,s,t=b,o=[],...l)=>{const r=h(e);return P((()=>t(null==r?void 0:r["del"+s](...l))),[r,s,...o,...l])},E=(e,s,t)=>{const o=T(e);return P((()=>null==o?void 0:o[s](t)),[o,s,t])},F=e=>M(n,h(e),[],[]),G=(e,s)=>M(u,h(s),[],[e]),Q=(e,s,t,o=0,l,r)=>M(i,h(r),[],[e,s,t,o,l],6),U=(e,s,t)=>M(c,h(t),[],[e,s]),z=(e,s,t,o)=>M(I,h(o),void 0,[e,s,t],4),H=(e,s)=>M("Metric",y(s),void 0,[e]),J=(e,s)=>M("SliceIds",f(s),[],[e]),K=(e,s,t)=>M("SliceRowIds",f(t),[],[e,s]),N=(e,s,t)=>M("RemoteRowId",L(t),void 0,[e,s]),W=(e,s,t)=>M("LocalRowIds",L(t),[],[e,s]),X=(e,s,t)=>M("LinkedRowIds",L(t),[],[e,s]),Y=(e,s)=>M("ResultRowIds",S(s),[],[e]),Z=(e,s,t,o=0,l,r)=>M("ResultSortedRowIds",S(r),[],[e,s,t,o,l],6),$=(e,s,t)=>M("ResultCellIds",S(t),[],[e,s]),_=(e,s,t,o)=>M("ResultCell",S(o),void 0,[e,s,t]),ee=e=>M("CheckpointIds",T(e),[[],void 0,[]]),se=(e,s)=>M("Checkpoint",T(s),void 0,[e]),te=e=>E(e,"goBackward"),oe=e=>E(e,"goForward");var le=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,ae=(e,s,t)=>s in e?le(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ce=(e,s)=>{for(var t in s||(s={}))ue.call(s,t)&&ae(e,t,s[t]);if(de)for(var t of de(s))ie.call(s,t)&&ae(e,t,s[t]);return e},Ie=(e,s)=>re(e,ne(s)),we=(e,s)=>{var t={};for(var o in e)ue.call(e,o)&&s.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&de)for(var o of de(e))s.indexOf(o)<0&&ie.call(e,o)&&(t[o]=e[o]);return t};const{createElement:Re,useMemo:pe}=s,be=({tableId:e,store:s,rowComponent:t=fe,getRowComponentProps:o,separator:l,debugIds:r},n)=>he(w(n,(l=>Re(t,Ie(ce({},me(o,l)),{key:l,tableId:e,rowId:l,store:s,debugIds:r})))),l,r,e),Ce=({queryId:e,queries:s,resultRowComponent:t=Pe,getResultRowComponentProps:o,separator:l,debugIds:r},n)=>he(w(n,(l=>Re(t,Ie(ce({},me(o,l)),{key:l,queryId:e,rowId:l,queries:s,debugIds:r})))),l,r,e),ke=e=>{const s=L(e);return[s,null==s?void 0:s.getStore()]},ge=({relationshipId:e,relationships:s,rowComponent:t=fe,getRowComponentProps:o,separator:l,debugIds:r},n,d)=>{const[u,i]=ke(s),a=null==u?void 0:u.getLocalTableId(e),c=n(e,d,u);return he(w(c,(e=>Re(t,Ie(ce({},me(o,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:r})))),l,r,d)},ve=e=>({checkpoints:s,checkpointComponent:t=xe,getCheckpointComponentProps:o,separator:l,debugIds:r})=>{const n=T(s);return he(w(e(ee(n)),(e=>Re(t,Ie(ce({},me(o,e)),{key:e,checkpoints:n,checkpointId:e,debugIds:r})))),l)},me=(e,s)=>R(e)?{}:e(s),he=(e,s,t,o)=>{const l=R(s)||!Array.isArray(e)?e:w(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",l,"}"]:l},ye=({tableId:e,rowId:s,cellId:t,store:l,debugIds:r})=>{var n;return he(o+(null!=(n=z(e,s,t,l))?n:o),void 0,r,t)},fe=({tableId:e,rowId:s,store:t,cellComponent:o=ye,getCellComponentProps:l,separator:r,debugIds:n})=>he(w(U(e,s,t),(r=>Re(o,Ie(ce({},me(l,r)),{key:r,tableId:e,rowId:s,cellId:r,store:t,debugIds:n})))),r,n,s),Le=e=>be(e,G(e.tableId,e.store)),Se=({indexId:e,sliceId:s,indexes:t,rowComponent:o=fe,getRowComponentProps:l,separator:r,debugIds:n})=>{const d=f(t),u=null==d?void 0:d.getStore(),i=null==d?void 0:d.getTableId(e),a=K(e,s,d);return he(w(a,(e=>Re(o,Ie(ce({},me(l,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:n})))),r,n,s)},Te=({queryId:e,rowId:s,cellId:t,queries:l,debugIds:r})=>{var n;return he(o+(null!=(n=_(e,s,t,l))?n:o),void 0,r,t)},Pe=({queryId:e,rowId:s,queries:t,resultCellComponent:o=Te,getResultCellComponentProps:l,separator:r,debugIds:n})=>he(w($(e,s,t),(r=>Re(o,Ie(ce({},me(l,r)),{key:r,queryId:e,rowId:s,cellId:r,queries:t,debugIds:n})))),r,n,s),xe=({checkpoints:e,checkpointId:s,debugIds:t})=>{var l;return he(null!=(l=se(s,e))?l:o,void 0,t,s)},Ve=ve((e=>e[0])),qe=ve((e=>R(e[1])?[]:[e[1]])),Oe=ve((e=>e[2]));e.BackwardCheckpointsView=Ve,e.CellView=ye,e.CheckpointView=xe,e.CurrentCheckpointView=qe,e.ForwardCheckpointsView=Oe,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Se,getSliceComponentProps:o,separator:l,debugIds:r})=>he(w(J(e,s),(l=>Re(t,Ie(ce({},me(o,l)),{key:l,indexId:e,sliceId:l,indexes:s,debugIds:r})))),l,r,e),e.LinkedRowsView=e=>ge(e,X,e.firstRowId),e.LocalRowsView=e=>ge(e,W,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var l;return he(null!=(l=H(e,s))?l:o,void 0,t,e)},e.Provider=({store:e,storesById:t,metrics:o,metricsById:l,indexes:r,indexesById:n,relationships:d,relationshipsById:u,queries:i,queriesById:a,checkpoints:c,checkpointsById:I,children:w})=>{const R=s.useContext(g);return Re(g.Provider,{value:pe((()=>[null!=e?e:R[0],ce(ce({},R[1]),t),null!=o?o:R[2],ce(ce({},R[3]),l),null!=r?r:R[4],ce(ce({},R[5]),n),null!=d?d:R[6],ce(ce({},R[7]),u),null!=i?i:R[8],ce(ce({},R[9]),a),null!=c?c:R[10],ce(ce({},R[11]),I)]),[e,t,o,l,r,n,d,u,i,a,c,I,R])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=fe,getRowComponentProps:l,debugIds:r})=>{const[n,d]=ke(t),u=null==n?void 0:n.getRemoteTableId(e),i=N(e,s,n);return he(R(u)||R(i)?null:Re(o,Ie(ce({},me(l,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:r})),void 0,r,s)},e.ResultCellView=Te,e.ResultRowView=Pe,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:o,offset:l,limit:r}=s,n=we(s,["cellId","descending","offset","limit"]);return Ce(n,Z(n.queryId,t,o,l,r,n.queries))},e.ResultTableView=e=>Ce(e,Y(e.queryId,e.queries)),e.RowView=fe,e.SliceView=Se,e.SortedTableView=e=>{var s=e,{cellId:t,descending:o,offset:l,limit:r}=s,n=we(s,["cellId","descending","offset","limit"]);return be(n,Q(n.tableId,t,o,l,r,n.store))},e.TableView=Le,e.TablesView=({store:e,tableComponent:s=Le,getTableComponentProps:t,separator:o,debugIds:l})=>he(w(F(e),(o=>Re(s,Ie(ce({},me(t,o)),{key:o,tableId:o,store:e,debugIds:l})))),o),e.tableView=be,e.useAddRowCallback=(e,s,t=[],o,l=b,r=[])=>{const n=h(o);return P((t=>p(n,(o=>p(s(t,o),(s=>l(o.addRow(e,s),o,s)))))),[n,e,...t,...r])},e.useCell=z,e.useCellIds=U,e.useCellIdsListener=(e,s,t,o,l,r)=>j(c,h(r),t,o,[e,s],l),e.useCellListener=(e,s,t,o,l,r,n)=>j(I,h(n),o,l,[e,s,t],r),e.useCheckpoint=se,e.useCheckpointIds=ee,e.useCheckpointIdsListener=(e,s,t)=>j("CheckpointIds",T(t),e,s),e.useCheckpointListener=(e,s,t,o)=>j("Checkpoint",T(o),s,t,[e]),e.useCheckpoints=e=>v(e,10),e.useCreateCheckpoints=(e,s,t)=>B(e,s,t),e.useCreateIndexes=(e,s,t)=>B(e,s,t),e.useCreateMetrics=(e,s,t)=>B(e,s,t),e.useCreatePersister=(e,s,t=[],o,l=[])=>{const[,r]=O(),n=V((()=>s(e)),[e,...t]);return x((()=>{var e,s,t;return e=void 0,s=null,t=function*(){yield null==o?void 0:o(n),r(1)},new Promise(((o,l)=>{var r=e=>{try{d(t.next(e))}catch(e){l(e)}},n=e=>{try{d(t.throw(e))}catch(e){l(e)}},d=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,n);d((t=t.apply(e,s)).next())})),()=>{n.destroy()}}),[n,...l]),n},e.useCreateQueries=(e,s,t)=>B(e,s,t),e.useCreateRelationships=(e,s,t)=>B(e,s,t),e.useCreateStore=(e,s=[])=>V(e,s),e.useDelCellCallback=(e,s,t,o,l,r,n)=>A(l,I,r,n,e,s,t,o),e.useDelRowCallback=(e,s,t,o,l)=>A(t,a,o,l,e,s),e.useDelTableCallback=(e,s,t,o)=>A(s,d,t,o,e),e.useDelTablesCallback=(e,s,t)=>A(e,r,s,t),e.useGoBackwardCallback=te,e.useGoForwardCallback=oe,e.useGoToCallback=(e,s=[],t,o=b,l=[])=>{const r=T(t);return P((s=>p(r,(t=>p(e(s),(e=>o(t.goTo(e),e)))))),[r,...s,...l])},e.useIndexes=e=>v(e,4),e.useLinkedRowIds=X,e.useLinkedRowIdsListener=(e,s,t,o,l)=>j("LinkedRowIds",L(l),t,o,[e,s]),e.useLocalRowIds=W,e.useLocalRowIdsListener=(e,s,t,o,l)=>j("LocalRowIds",L(l),t,o,[e,s]),e.useMetric=H,e.useMetricListener=(e,s,t,o)=>j("Metric",y(o),s,t,[e]),e.useMetrics=e=>v(e,2),e.useQueries=e=>v(e,8),e.useRedoInformation=e=>{var s;const t=T(e),[,,[l]]=ee(t);return[!R(l),oe(t),l,null!=(s=p(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:o]},e.useRelationships=e=>v(e,6),e.useRemoteRowId=N,e.useRemoteRowIdListener=(e,s,t,o,l)=>j("RemoteRowId",L(l),t,o,[e,s]),e.useResultCell=_,e.useResultCellIds=$,e.useResultCellIdsListener=(e,s,t,o,l)=>j("ResultCellIds",S(l),t,o,[e,s]),e.useResultCellListener=(e,s,t,o,l,r)=>j("ResultCell",S(r),o,l,[e,s,t]),e.useResultRow=(e,s,t)=>M("ResultRow",S(t),{},[e,s]),e.useResultRowIds=Y,e.useResultRowIdsListener=(e,s,t,o)=>j("ResultRowIds",S(o),s,t,[e]),e.useResultRowListener=(e,s,t,o,l)=>j("ResultRow",S(l),t,o,[e,s]),e.useResultSortedRowIds=Z,e.useResultSortedRowIdsListener=(e,s,t,o,l,r,n,d)=>j("ResultSortedRowIds",S(d),r,n,[e,s,t,o,l]),e.useResultTable=(e,s)=>M("ResultTable",S(s),{},[e]),e.useResultTableListener=(e,s,t,o)=>j("ResultTable",S(o),s,t,[e]),e.useRow=(e,s,t)=>M(a,h(t),{},[e,s]),e.useRowIds=G,e.useRowIdsListener=(e,s,t,o,l)=>j(u,h(l),s,t,[e],o),e.useRowListener=(e,s,t,o,l,r)=>j(a,h(r),t,o,[e,s],l),e.useSetCellCallback=(e,s,t,o,l,r,n,d)=>D(r,I,o,l,n,d,e,s,t),e.useSetCheckpointCallback=(e=b,s=[],t,o=b,l=[])=>{const r=T(t);return P((s=>p(r,(t=>{const l=e(s);o(t.addCheckpoint(l),t,l)}))),[r,...s,...l])},e.useSetPartialRowCallback=(e,s,t,o,l,r,n)=>D(l,"PartialRow",t,o,r,n,e,s),e.useSetRowCallback=(e,s,t,o,l,r,n)=>D(l,a,t,o,r,n,e,s),e.useSetTableCallback=(e,s,t,o,l,r)=>D(o,d,s,t,l,r,e),e.useSetTablesCallback=(e,s,t,o,l)=>D(t,r,e,s,o,l),e.useSliceIds=J,e.useSliceIdsListener=(e,s,t,o)=>j("SliceIds",f(o),s,t,[e]),e.useSliceRowIds=K,e.useSliceRowIdsListener=(e,s,t,o,l)=>j("SliceRowIds",f(l),t,o,[e,s]),e.useSortedRowIds=Q,e.useSortedRowIdsListener=(e,s,t,o,l,r,n,d,u)=>j(i,h(u),r,n,[e,s,t,o,l],d),e.useStore=e=>v(e,0),e.useTable=(e,s)=>M(d,h(s),{},[e]),e.useTableIds=F,e.useTableIdsListener=(e,s,t,o)=>j(n,h(o),e,s,[],t),e.useTableListener=(e,s,t,o,l)=>j(d,h(l),s,t,[e],o),e.useTables=e=>M(r,h(e),{}),e.useTablesListener=(e,s,t,o)=>j(r,h(o),e,s,[],t),e.useUndoInformation=e=>{var s;const t=T(e),[l,r]=ee(t);return[(n=l,!(0==(e=>e.length)(n))),te(t),r,null!=(s=p(r,(e=>null==t?void 0:t.getCheckpoint(e))))?s:o];var n}},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -59,44 +59,44 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@babel/cli": "^7.19.3",
62
- "@babel/core": "^7.19.3",
63
- "@babel/preset-env": "^7.19.3",
62
+ "@babel/core": "^7.20.2",
63
+ "@babel/preset-env": "^7.20.2",
64
64
  "@babel/preset-react": "^7.18.6",
65
65
  "@babel/preset-typescript": "^7.18.6",
66
- "@rollup/plugin-replace": "^4.0.0",
66
+ "@rollup/plugin-replace": "^5.0.1",
67
67
  "@types/asciichart": "^1.5.6",
68
- "@types/expect-puppeteer": "^5.0.1",
68
+ "@types/expect-puppeteer": "^5.0.2",
69
69
  "@types/http-server": "^0.12.1",
70
- "@types/jest": "^29.1.1",
71
- "@types/jest-environment-puppeteer": "^5.0.2",
70
+ "@types/jest": "^29.2.2",
71
+ "@types/jest-environment-puppeteer": "^5.0.3",
72
72
  "@types/less": "^3.0.3",
73
- "@types/node": "^18.7.23",
74
- "@types/puppeteer": "^5.4.6",
73
+ "@types/node": "^18.11.9",
74
+ "@types/puppeteer": "^5.4.7",
75
75
  "@types/react": "^17.0.41",
76
76
  "@types/react-dom": "^17.0.14",
77
77
  "@types/react-test-renderer": "^17.0.1",
78
78
  "@types/tmp": "^0.2.3",
79
- "@typescript-eslint/eslint-plugin": "^5.38.1",
80
- "@typescript-eslint/parser": "^5.38.1",
79
+ "@typescript-eslint/eslint-plugin": "^5.42.0",
80
+ "@typescript-eslint/parser": "^5.42.0",
81
81
  "asciichart": "^1.5.25",
82
82
  "babel-eslint": "^10.1.0",
83
- "babel-jest": "^29.1.2",
83
+ "babel-jest": "^29.2.2",
84
84
  "babel-preset-minify": "^0.5.2",
85
85
  "buffer-replace": "^1.0.0",
86
86
  "country-flag-emoji-json": "^2.0.0",
87
- "cspell": "^6.12.0",
88
- "esbuild": "^0.15.10",
89
- "eslint": "^8.24.0",
87
+ "cspell": "^6.14.0",
88
+ "esbuild": "^0.15.13",
89
+ "eslint": "^8.27.0",
90
90
  "eslint-config-prettier": "^8.5.0",
91
- "eslint-plugin-jest": "^27.0.4",
92
- "eslint-plugin-jsdoc": "^39.3.6",
93
- "eslint-plugin-react": "^7.31.8",
91
+ "eslint-plugin-jest": "^27.1.4",
92
+ "eslint-plugin-jsdoc": "^39.6.2",
93
+ "eslint-plugin-react": "^7.31.10",
94
94
  "eslint-plugin-react-hooks": "^4.6.0",
95
95
  "gulp": "^4.0.2",
96
96
  "gulp-gzip": "^1.4.2",
97
97
  "http-server": "^14.1.1",
98
- "jest": "^29.1.2",
99
- "jest-environment-jsdom": "^29.1.2",
98
+ "jest": "^29.2.2",
99
+ "jest-environment-jsdom": "^29.2.2",
100
100
  "jest-fetch-mock": "^3.0.3",
101
101
  "jest-puppeteer": "^6.1.1",
102
102
  "less": "^4.1.3",
@@ -105,10 +105,10 @@
105
105
  "react": "^17.0.2",
106
106
  "react-dom": "^17.0.2",
107
107
  "react-test-renderer": "^17.0.2",
108
- "rollup": "^2.79.1",
108
+ "rollup": "^3.2.5",
109
109
  "rollup-plugin-esbuild": "^4.10.1",
110
- "rollup-plugin-gzip": "^3.0.1",
111
- "rollup-plugin-prettier": "^2.2.2",
110
+ "rollup-plugin-gzip": "^3.1.0",
111
+ "rollup-plugin-prettier": "^3.0.0",
112
112
  "rollup-plugin-terser": "^7.0.2",
113
113
  "tinydocs": "^0.1.15",
114
114
  "tmp": "^0.2.1",
package/readme.md CHANGED
@@ -235,4 +235,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
235
235
  // -> false
236
236
  ```
237
237
 
238
- <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>3.5kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>7.8kB</em>.</p><p>The <code>ui-react</code> adaptor is just another <em>3.2kB</em>, and everything is fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store">store</a></th><td>3.5kB</td><td>7.7kB</td><td>33.1kB</td><td>127.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.6kB</td><td>29.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.4kB</td><td>33.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships">relationships</a></th><td>1.8kB</td><td>3.6kB</td><td>16.6kB</td><td>42.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries">queries</a></th><td>2.6kB</td><td>5.5kB</td><td>24.9kB</td><td>106.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints">checkpoints</a></th><td>1.4kB</td><td>2.8kB</td><td>11.2kB</td><td>33.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters">persisters</a></th><td>0.8kB</td><td>1.6kB</td><td>5.0kB</td><td>26.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>7.8kB</td><td>18.4kB</td><td>80.8kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,246</td><td>1,246</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,347</td><td>1,347</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>507</td><td>507</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>469</td><td>469</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">2,134</td></tr><tr><th class="right">Assertions</th><td colspan="3">11,009</td></tr></tbody></table></div><hr><p><a id="start" href="https://tinybase.org/guides/the-basics/getting-started">Get started</a></p><p><a href="https://tinybase.org/demos">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a> and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://tinybase.org/guides/releases/">Release notes</a> for each version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/2.1.0">NPM</a>.</li><li><a href="https://github.com/tinyplex/tinybase/issues">Issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was an interesting exercise in API design, minification, and documentation. It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and we hope you enjoy using it!</p></section>
238
+ <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>3.5kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>7.8kB</em>.</p><p>The <code>ui-react</code> adaptor is just another <em>3.2kB</em>, and everything is fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store">store</a></th><td>3.5kB</td><td>7.7kB</td><td>33.2kB</td><td>127.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.6kB</td><td>29.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.4kB</td><td>33.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships">relationships</a></th><td>1.8kB</td><td>3.6kB</td><td>16.6kB</td><td>42.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries">queries</a></th><td>2.6kB</td><td>5.5kB</td><td>24.9kB</td><td>106.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints">checkpoints</a></th><td>1.4kB</td><td>2.8kB</td><td>11.2kB</td><td>33.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters">persisters</a></th><td>0.8kB</td><td>1.6kB</td><td>5.0kB</td><td>26.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>7.8kB</td><td>18.4kB</td><td>80.9kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,247</td><td>1,247</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,348</td><td>1,348</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>507</td><td>507</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>469</td><td>469</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">2,134</td></tr><tr><th class="right">Assertions</th><td colspan="3">11,009</td></tr></tbody></table></div><hr><p><a id="start" href="https://tinybase.org/guides/the-basics/getting-started">Get started</a></p><p><a href="https://tinybase.org/demos">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a> and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://tinybase.org/guides/releases/">Release notes</a> for each version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/2.1.1">NPM</a>.</li><li><a href="https://github.com/tinyplex/tinybase/issues">Issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was an interesting exercise in API design, minification, and documentation. It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and we hope you enjoy using it!</p></section>