@visulima/pagination 3.0.19 → 3.0.21
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/CHANGELOG.md +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/Paginator-DEUcrtkG.cjs +1 -0
- package/dist/{shared/Paginator-C6gi23wH.mjs → packem_shared/Paginator-DevEsY78.mjs} +1 -1
- package/dist/{shared/createPaginationMetaSchemaObject-CgcOmsL3.mjs → packem_shared/createPaginationMetaSchemaObject-6bBOLPmK.mjs} +1 -1
- package/package.json +5 -5
- package/dist/shared/Paginator-C0enktNL.cjs +0 -1
- /package/dist/{shared → packem_shared}/createPaginationMetaSchemaObject-D-0GFE4M.cjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @visulima/pagination [3.0.21](https://github.com/visulima/visulima/compare/@visulima/pagination@3.0.20...@visulima/pagination@3.0.21) (2024-09-11)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* fixed node10 support ([f5e78d9](https://github.com/visulima/visulima/commit/f5e78d9bff8fd603967666598b34f9338a8726b5))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* updated dev dependencies ([28b5ee5](https://github.com/visulima/visulima/commit/28b5ee5c805ca8868536418829cde7ba8c5bb8dd))
|
|
10
|
+
|
|
11
|
+
## @visulima/pagination [3.0.20](https://github.com/visulima/visulima/compare/@visulima/pagination@3.0.19...@visulima/pagination@3.0.20) (2024-09-07)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* fixed broken chunk splitting from packem ([1aaf277](https://github.com/visulima/visulima/commit/1aaf27779292d637923c5f8a220e18606e78caa2))
|
|
16
|
+
|
|
1
17
|
## @visulima/pagination [3.0.19](https://github.com/visulima/visulima/compare/@visulima/pagination@3.0.18...@visulima/pagination@3.0.19) (2024-09-07)
|
|
2
18
|
|
|
3
19
|
### Bug Fixes
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var t=(e,a)=>o(e,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./
|
|
1
|
+
"use strict";var o=Object.defineProperty;var t=(e,a)=>o(e,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./packem_shared/Paginator-DEUcrtkG.cjs"),c=require("./packem_shared/createPaginationMetaSchemaObject-D-0GFE4M.cjs");var g=Object.defineProperty,b=t((e,a)=>g(e,"name",{value:a,configurable:!0}),"e");const m=b((e,a,i,r)=>new n(i,Number(a),Number(e),...r),"paginate");exports.Paginator=n;exports.createPaginationMetaSchemaObject=c.createPaginationMetaSchemaObject;exports.createPaginationSchemaObject=c.createPaginationSchemaObject;exports.paginate=m;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=Object.defineProperty;var t=(a
|
|
1
|
+
var o=Object.defineProperty;var t=(e,a)=>o(e,"name",{value:a,configurable:!0});import i from"./packem_shared/Paginator-DevEsY78.mjs";import{createPaginationMetaSchemaObject as P,createPaginationSchemaObject as j}from"./packem_shared/createPaginationMetaSchemaObject-6bBOLPmK.mjs";var c=Object.defineProperty,m=t((e,a)=>c(e,"name",{value:a,configurable:!0}),"e");const p=m((e,a,r,n)=>new i(r,Number(a),Number(e),...n),"paginate");export{i as Paginator,P as createPaginationMetaSchemaObject,j as createPaginationSchemaObject,p as paginate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var W=Object.defineProperty;var a=(i,t)=>W(i,"name",{value:t,configurable:!0});const G=String.prototype.replace,H=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"},J={RFC1738:a(function(i){return G.call(i,H,"+")},"RFC1738"),RFC3986:a(function(i){return String(i)},"RFC3986")},_=I.RFC1738,L=I.RFC3986,X=Array.isArray,p=function(){const i=[];for(let t=0;t<256;++t)i.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return i}(),A=1024,Y=a(function(t,r,e,o,y){if(t.length===0)return t;let g=t;if(typeof t=="symbol"?g=Symbol.prototype.toString.call(t):typeof t!="string"&&(g=String(t)),e==="iso-8859-1")return escape(g).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});let m="";for(let h=0;h<g.length;h+=A){const u=g.length>=A?g.slice(h,h+A):g,l=[];for(let f=0;f<u.length;++f){let n=u.charCodeAt(f);if(n===45||n===46||n===95||n===126||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||y===_&&(n===40||n===41)){l[l.length]=u.charAt(f);continue}if(n<128){l[l.length]=p[n];continue}if(n<2048){l[l.length]=p[192|n>>6]+p[128|n&63];continue}if(n<55296||n>=57344){l[l.length]=p[224|n>>12]+p[128|n>>6&63]+p[128|n&63];continue}f+=1,n=65536+((n&1023)<<10|u.charCodeAt(f)&1023),l[l.length]=p[240|n>>18]+p[128|n>>12&63]+p[128|n>>6&63]+p[128|n&63]}m+=l.join("")}return m},"encode"),Z=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),O=a(function(t,r){if(X(t)){const e=[];for(let o=0;o<t.length;o+=1)e.push(r(t[o]));return e}return r(t)},"maybeMap"),V={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},d=Array.isArray,tt=Array.prototype.push,K=a(function(i,t){tt.apply(i,d(t)?t:[t])},"pushToArray"),et=Date.prototype.toISOString,z=L,j={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Y,encodeValuesOnly:!1,format:z,formatter:J[z],indices:!1,serializeDate:a(function(t){return et.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},nt=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),E={},$=a(function(t,r,e,o,y,g,m,h,u,l,f,n,P,U,b,S,F,w){let s=t,N=w,C=0,B=!1;for(;(N=N.get(E))!==void 0&&!B;){const c=N.get(t);if(C+=1,typeof c<"u"){if(c===C)throw new RangeError("Cyclic object value");B=!0}typeof N.get(E)>"u"&&(C=0)}if(typeof l=="function"?s=l(r,s):s instanceof Date?s=P(s):e==="comma"&&d(s)&&(s=O(s,function(c){return c instanceof Date?P(c):c})),s===null){if(g)return u&&!S?u(r,j.encoder,F,"key",U):r;s=""}if(nt(s)||Z(s)){if(u){const c=S?r:u(r,j.encoder,F,"key",U);return[b(c)+"="+b(u(s,j.encoder,F,"value",U))]}return[b(r)+"="+b(String(s))]}const M=[];if(typeof s>"u")return M;let k;if(e==="comma"&&d(s))S&&u&&(s=O(s,u)),k=[{value:s.length>0?s.join(",")||null:void 0}];else if(d(l))k=l;else{const c=Object.keys(s);k=f?c.sort(f):c}const T=h?r.replace(/\./g,"%2E"):r,R=o&&d(s)&&s.length===1?T+"[]":T;if(y&&d(s)&&s.length===0)return R+"[]";for(let c=0;c<k.length;++c){const x=k[c],q=typeof x=="object"&&typeof x.value<"u"?x.value:s[x];if(m&&q===null)continue;const v=n&&h?x.replace(/\./g,"%2E"):x,Q=d(s)?typeof e=="function"?e(R,v):R:R+(n?"."+v:"["+v+"]");w.set(t,C);const D=new WeakMap;D.set(E,w),K(M,$(q,Q,e,o,y,g,m,h,e==="comma"&&S&&d(s)?null:u,l,f,n,P,U,b,S,F,D))}return M},"stringify"),rt=a(function(t){return j},"normalizeStringifyOptions");function st(i,t){let r=i;const e=rt();let o,y;typeof e.filter=="function"?(y=e.filter,r=y("",r)):d(e.filter)&&(y=e.filter,o=y);const g=[];if(typeof r!="object"||r===null)return"";const m=V[e.arrayFormat],h=m==="comma"&&e.commaRoundTrip;o||(o=Object.keys(r)),e.sort&&o.sort(e.sort);const u=new WeakMap;for(let n=0;n<o.length;++n){const P=o[n];e.skipNulls&&r[P]===null||K(g,$(r[P],P,m,h,e.allowEmptyArrays,e.strictNullHandling,e.skipNulls,e.encodeDotInKeys,e.encode?e.encoder:null,e.filter,e.sort,e.allowDots,e.serializeDate,e.format,e.formatter,e.encodeValuesOnly,e.charset,u))}const l=g.join(e.delimiter);let f=e.addQueryPrefix===!0?"?":"";return e.charsetSentinel&&(e.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}a(st,"stringify");var it=Object.defineProperty,ot=a((i,t)=>it(i,"name",{value:t,configurable:!0}),"n");class lt extends Array{static{a(this,"g")}constructor(t,r,e,...o){super(...o),this.totalNumber=t,this.perPage=r,this.currentPage=e,this.totalNumber=Number(t),this.rows=o,this.isEmpty=this.rows.length===0}static{ot(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(t){return this.url=t,this}getMeta(){return{firstPage:this.firstPage,firstPageUrl:this.getUrl(1),lastPage:this.lastPage,lastPageUrl:this.getUrl(this.lastPage),nextPageUrl:this.getNextPageUrl(),page:this.currentPage,perPage:this.perPage,previousPageUrl:this.getPreviousPageUrl(),total:this.total}}getNextPageUrl(){return this.hasMorePages?this.getUrl(this.currentPage+1):null}getPreviousPageUrl(){return this.currentPage>1?this.getUrl(this.currentPage-1):null}getUrl(t){const r=st({...this.qs,page:t<1?1:t});return`${this.url}?${r}`}getUrlsForRange(t,r){const e=[];for(let o=t;o<=r;o++)e.push({isActive:o===this.currentPage,page:o,url:this.getUrl(o)});return e}queryString(t){return this.qs=t,this}toJSON(){return{data:this.all(),meta:this.getMeta()}}get hasMorePages(){return this.lastPage>this.currentPage}get hasPages(){return this.lastPage!==1}get hasTotal(){return this.total>0}get lastPage(){return Math.max(Math.ceil(this.total/this.perPage),1)}get total(){return Number(this.totalNumber)}}module.exports=lt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var W=Object.defineProperty;var a=(i,t)=>W(i,"name",{value:t,configurable:!0});const G=String.prototype.replace,H=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"},J={RFC1738:a(function(i){return G.call(i,H,"+")},"RFC1738"),RFC3986:a(function(i){return String(i)},"RFC3986")},_=I.RFC1738,L=I.RFC3986,X=Array.isArray,p=function(){const i=[];for(let t=0;t<256;++t)i.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return i}(),A=1024,Y=a(function(t,r,e,o,y){if(t.length===0)return t;let g=t;if(typeof t=="symbol"?g=Symbol.prototype.toString.call(t):typeof t!="string"&&(g=String(t)),e==="iso-8859-1")return escape(g).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});let m="";for(let h=0;h<g.length;h+=A){const u=g.length>=A?g.slice(h,h+A):g,l=[];for(let f=0;f<u.length;++f){let n=u.charCodeAt(f);if(n===45||n===46||n===95||n===126||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||y===_&&(n===40||n===41)){l[l.length]=u.charAt(f);continue}if(n<128){l[l.length]=p[n];continue}if(n<2048){l[l.length]=p[192|n>>6]+p[128|n&63];continue}if(n<55296||n>=57344){l[l.length]=p[224|n>>12]+p[128|n>>6&63]+p[128|n&63];continue}f+=1,n=65536+((n&1023)<<10|u.charCodeAt(f)&1023),l[l.length]=p[240|n>>18]+p[128|n>>12&63]+p[128|n>>6&63]+p[128|n&63]}m+=l.join("")}return m},"encode"),Z=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),O=a(function(t,r){if(X(t)){const e=[];for(let o=0;o<t.length;o+=1)e.push(r(t[o]));return e}return r(t)},"maybeMap"),V={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},d=Array.isArray,tt=Array.prototype.push,K=a(function(i,t){tt.apply(i,d(t)?t:[t])},"pushToArray"),et=Date.prototype.toISOString,z=L,j={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Y,encodeValuesOnly:!1,format:z,formatter:J[z],indices:!1,serializeDate:a(function(t){return et.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},nt=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),E={},$=a(function(t,r,e,o,y,g,m,h,u,l,f,n,P,U,b,S,F,w){let s=t,N=w,C=0,B=!1;for(;(N=N.get(E))!==void 0&&!B;){const c=N.get(t);if(C+=1,typeof c<"u"){if(c===C)throw new RangeError("Cyclic object value");B=!0}typeof N.get(E)>"u"&&(C=0)}if(typeof l=="function"?s=l(r,s):s instanceof Date?s=P(s):e==="comma"&&d(s)&&(s=O(s,function(c){return c instanceof Date?P(c):c})),s===null){if(g)return u&&!S?u(r,j.encoder,F,"key",U):r;s=""}if(nt(s)||Z(s)){if(u){const c=S?r:u(r,j.encoder,F,"key",U);return[b(c)+"="+b(u(s,j.encoder,F,"value",U))]}return[b(r)+"="+b(String(s))]}const M=[];if(typeof s>"u")return M;let k;if(e==="comma"&&d(s))S&&u&&(s=O(s,u)),k=[{value:s.length>0?s.join(",")||null:void 0}];else if(d(l))k=l;else{const c=Object.keys(s);k=f?c.sort(f):c}const T=h?r.replace(/\./g,"%2E"):r,R=o&&d(s)&&s.length===1?T+"[]":T;if(y&&d(s)&&s.length===0)return R+"[]";for(let c=0;c<k.length;++c){const x=k[c],q=typeof x=="object"&&typeof x.value<"u"?x.value:s[x];if(m&&q===null)continue;const v=n&&h?x.replace(/\./g,"%2E"):x,Q=d(s)?typeof e=="function"?e(R,v):R:R+(n?"."+v:"["+v+"]");w.set(t,C);const D=new WeakMap;D.set(E,w),K(M,$(q,Q,e,o,y,g,m,h,e==="comma"&&S&&d(s)?null:u,l,f,n,P,U,b,S,F,D))}return M},"stringify"),rt=a(function(t){return j},"normalizeStringifyOptions");function st(i,t){let r=i;const e=rt();let o,y;typeof e.filter=="function"?(y=e.filter,r=y("",r)):d(e.filter)&&(y=e.filter,o=y);const g=[];if(typeof r!="object"||r===null)return"";const m=V[e.arrayFormat],h=m==="comma"&&e.commaRoundTrip;o||(o=Object.keys(r)),e.sort&&o.sort(e.sort);const u=new WeakMap;for(let n=0;n<o.length;++n){const P=o[n];e.skipNulls&&r[P]===null||K(g,$(r[P],P,m,h,e.allowEmptyArrays,e.strictNullHandling,e.skipNulls,e.encodeDotInKeys,e.encode?e.encoder:null,e.filter,e.sort,e.allowDots,e.serializeDate,e.format,e.formatter,e.encodeValuesOnly,e.charset,u))}const l=g.join(e.delimiter);let f=e.addQueryPrefix===!0?"?":"";return e.charsetSentinel&&(e.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}a(st,"stringify");var it=Object.defineProperty,ot=a((i,t)=>it(i,"name",{value:t,configurable:!0}),"n");class at extends Array{static{a(this,"g")}constructor(t,r,e,...o){super(...o),this.totalNumber=t,this.perPage=r,this.currentPage=e,this.totalNumber=Number(t),this.rows=o,this.isEmpty=this.rows.length===0}static{ot(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(t){return this.url=t,this}getMeta(){return{firstPage:this.firstPage,firstPageUrl:this.getUrl(1),lastPage:this.lastPage,lastPageUrl:this.getUrl(this.lastPage),nextPageUrl:this.getNextPageUrl(),page:this.currentPage,perPage:this.perPage,previousPageUrl:this.getPreviousPageUrl(),total:this.total}}getNextPageUrl(){return this.hasMorePages?this.getUrl(this.currentPage+1):null}getPreviousPageUrl(){return this.currentPage>1?this.getUrl(this.currentPage-1):null}getUrl(t){const r=st({...this.qs,page:t<1?1:t});return`${this.url}?${r}`}getUrlsForRange(t,r){const e=[];for(let o=t;o<=r;o++)e.push({isActive:o===this.currentPage,page:o,url:this.getUrl(o)});return e}queryString(t){return this.qs=t,this}toJSON(){return{data:this.all(),meta:this.getMeta()}}get hasMorePages(){return this.lastPage>this.currentPage}get hasPages(){return this.lastPage!==1}get hasTotal(){return this.total>0}get lastPage(){return Math.max(Math.ceil(this.total/this.perPage),1)}get total(){return Number(this.totalNumber)}}export{at as
|
|
1
|
+
var W=Object.defineProperty;var a=(i,t)=>W(i,"name",{value:t,configurable:!0});const G=String.prototype.replace,H=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"},J={RFC1738:a(function(i){return G.call(i,H,"+")},"RFC1738"),RFC3986:a(function(i){return String(i)},"RFC3986")},_=I.RFC1738,L=I.RFC3986,X=Array.isArray,p=function(){const i=[];for(let t=0;t<256;++t)i.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return i}(),A=1024,Y=a(function(t,r,e,o,y){if(t.length===0)return t;let g=t;if(typeof t=="symbol"?g=Symbol.prototype.toString.call(t):typeof t!="string"&&(g=String(t)),e==="iso-8859-1")return escape(g).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});let m="";for(let h=0;h<g.length;h+=A){const u=g.length>=A?g.slice(h,h+A):g,l=[];for(let f=0;f<u.length;++f){let n=u.charCodeAt(f);if(n===45||n===46||n===95||n===126||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||y===_&&(n===40||n===41)){l[l.length]=u.charAt(f);continue}if(n<128){l[l.length]=p[n];continue}if(n<2048){l[l.length]=p[192|n>>6]+p[128|n&63];continue}if(n<55296||n>=57344){l[l.length]=p[224|n>>12]+p[128|n>>6&63]+p[128|n&63];continue}f+=1,n=65536+((n&1023)<<10|u.charCodeAt(f)&1023),l[l.length]=p[240|n>>18]+p[128|n>>12&63]+p[128|n>>6&63]+p[128|n&63]}m+=l.join("")}return m},"encode"),Z=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),O=a(function(t,r){if(X(t)){const e=[];for(let o=0;o<t.length;o+=1)e.push(r(t[o]));return e}return r(t)},"maybeMap"),V={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},d=Array.isArray,tt=Array.prototype.push,K=a(function(i,t){tt.apply(i,d(t)?t:[t])},"pushToArray"),et=Date.prototype.toISOString,z=L,j={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Y,encodeValuesOnly:!1,format:z,formatter:J[z],indices:!1,serializeDate:a(function(t){return et.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},nt=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),E={},$=a(function(t,r,e,o,y,g,m,h,u,l,f,n,P,U,b,S,F,w){let s=t,N=w,C=0,B=!1;for(;(N=N.get(E))!==void 0&&!B;){const c=N.get(t);if(C+=1,typeof c<"u"){if(c===C)throw new RangeError("Cyclic object value");B=!0}typeof N.get(E)>"u"&&(C=0)}if(typeof l=="function"?s=l(r,s):s instanceof Date?s=P(s):e==="comma"&&d(s)&&(s=O(s,function(c){return c instanceof Date?P(c):c})),s===null){if(g)return u&&!S?u(r,j.encoder,F,"key",U):r;s=""}if(nt(s)||Z(s)){if(u){const c=S?r:u(r,j.encoder,F,"key",U);return[b(c)+"="+b(u(s,j.encoder,F,"value",U))]}return[b(r)+"="+b(String(s))]}const M=[];if(typeof s>"u")return M;let k;if(e==="comma"&&d(s))S&&u&&(s=O(s,u)),k=[{value:s.length>0?s.join(",")||null:void 0}];else if(d(l))k=l;else{const c=Object.keys(s);k=f?c.sort(f):c}const T=h?r.replace(/\./g,"%2E"):r,R=o&&d(s)&&s.length===1?T+"[]":T;if(y&&d(s)&&s.length===0)return R+"[]";for(let c=0;c<k.length;++c){const x=k[c],q=typeof x=="object"&&typeof x.value<"u"?x.value:s[x];if(m&&q===null)continue;const v=n&&h?x.replace(/\./g,"%2E"):x,Q=d(s)?typeof e=="function"?e(R,v):R:R+(n?"."+v:"["+v+"]");w.set(t,C);const D=new WeakMap;D.set(E,w),K(M,$(q,Q,e,o,y,g,m,h,e==="comma"&&S&&d(s)?null:u,l,f,n,P,U,b,S,F,D))}return M},"stringify"),rt=a(function(t){return j},"normalizeStringifyOptions");function st(i,t){let r=i;const e=rt();let o,y;typeof e.filter=="function"?(y=e.filter,r=y("",r)):d(e.filter)&&(y=e.filter,o=y);const g=[];if(typeof r!="object"||r===null)return"";const m=V[e.arrayFormat],h=m==="comma"&&e.commaRoundTrip;o||(o=Object.keys(r)),e.sort&&o.sort(e.sort);const u=new WeakMap;for(let n=0;n<o.length;++n){const P=o[n];e.skipNulls&&r[P]===null||K(g,$(r[P],P,m,h,e.allowEmptyArrays,e.strictNullHandling,e.skipNulls,e.encodeDotInKeys,e.encode?e.encoder:null,e.filter,e.sort,e.allowDots,e.serializeDate,e.format,e.formatter,e.encodeValuesOnly,e.charset,u))}const l=g.join(e.delimiter);let f=e.addQueryPrefix===!0?"?":"";return e.charsetSentinel&&(e.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}a(st,"stringify");var it=Object.defineProperty,ot=a((i,t)=>it(i,"name",{value:t,configurable:!0}),"n");class at extends Array{static{a(this,"g")}constructor(t,r,e,...o){super(...o),this.totalNumber=t,this.perPage=r,this.currentPage=e,this.totalNumber=Number(t),this.rows=o,this.isEmpty=this.rows.length===0}static{ot(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(t){return this.url=t,this}getMeta(){return{firstPage:this.firstPage,firstPageUrl:this.getUrl(1),lastPage:this.lastPage,lastPageUrl:this.getUrl(this.lastPage),nextPageUrl:this.getNextPageUrl(),page:this.currentPage,perPage:this.perPage,previousPageUrl:this.getPreviousPageUrl(),total:this.total}}getNextPageUrl(){return this.hasMorePages?this.getUrl(this.currentPage+1):null}getPreviousPageUrl(){return this.currentPage>1?this.getUrl(this.currentPage-1):null}getUrl(t){const r=st({...this.qs,page:t<1?1:t});return`${this.url}?${r}`}getUrlsForRange(t,r){const e=[];for(let o=t;o<=r;o++)e.push({isActive:o===this.currentPage,page:o,url:this.getUrl(o)});return e}queryString(t){return this.qs=t,this}toJSON(){return{data:this.all(),meta:this.getMeta()}}get hasMorePages(){return this.lastPage>this.currentPage}get hasPages(){return this.lastPage!==1}get hasTotal(){return this.total>0}get lastPage(){return Math.max(Math.ceil(this.total/this.perPage),1)}get total(){return Number(this.totalNumber)}}export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var n=Object.defineProperty;var a=(e,t)=>n(e,"name",{value:t,configurable:!0});var o=Object.defineProperty,i=a((e,t)=>o(e,"name",{value:t,configurable:!0}),"r");const s=i((e="PaginationData")=>({[e]:{properties:{firstPage:{description:"Returns the number for the first page. It is always 1",minimum:0,type:"integer"},firstPageUrl:{description:"The URL for the first page",type:"string"},lastPage:{description:"Returns the value for the last page by taking the total of rows into account",minimum:0,type:"integer"},lastPageUrl:{description:"The URL for the last page",type:"string"},nextPageUrl:{description:"The URL for the next page",type:"string"},page:{description:"Current page number",minimum:1,type:"integer"},perPage:{description:"Returns the value for the limit passed to the paginate method",minimum:0,type:"integer"},previousPageUrl:{description:"The URL for the previous page",type:"string"},total:{description:"Holds the value for the total number of rows in the database",minimum:0,type:"integer"}},type:"object",xml:{name:e}}}),"createPaginationMetaSchemaObject"),m=i((e,t,r="#/components/schemas/PaginationData")=>({[e]:{properties:{data:{items:t,type:"array",xml:{name:"data",wrapped:!0}},meta:{$ref:r}},type:"object",xml:{name:e}}}),"createPaginationSchemaObject");export{
|
|
1
|
+
var n=Object.defineProperty;var a=(e,t)=>n(e,"name",{value:t,configurable:!0});var o=Object.defineProperty,i=a((e,t)=>o(e,"name",{value:t,configurable:!0}),"r");const s=i((e="PaginationData")=>({[e]:{properties:{firstPage:{description:"Returns the number for the first page. It is always 1",minimum:0,type:"integer"},firstPageUrl:{description:"The URL for the first page",type:"string"},lastPage:{description:"Returns the value for the last page by taking the total of rows into account",minimum:0,type:"integer"},lastPageUrl:{description:"The URL for the last page",type:"string"},nextPageUrl:{description:"The URL for the next page",type:"string"},page:{description:"Current page number",minimum:1,type:"integer"},perPage:{description:"Returns the value for the limit passed to the paginate method",minimum:0,type:"integer"},previousPageUrl:{description:"The URL for the previous page",type:"string"},total:{description:"Holds the value for the total number of rows in the database",minimum:0,type:"integer"}},type:"object",xml:{name:e}}}),"createPaginationMetaSchemaObject"),m=i((e,t,r="#/components/schemas/PaginationData")=>({[e]:{properties:{data:{items:t,type:"array",xml:{name:"data",wrapped:!0}},meta:{$ref:r}},type:"object",xml:{name:e}}}),"createPaginationSchemaObject");export{s as createPaginationMetaSchemaObject,m as createPaginationSchemaObject};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pagination",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.21",
|
|
4
4
|
"description": "Simple Pagination for Node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"module": "dist/index.mjs",
|
|
51
51
|
"types": "dist/index.d.ts",
|
|
52
52
|
"typesVersions": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
53
|
+
">=5.0": {
|
|
54
|
+
".": [
|
|
55
55
|
"./dist/index.d.ts"
|
|
56
56
|
]
|
|
57
57
|
}
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"@anolilab/prettier-config": "^5.0.14",
|
|
68
68
|
"@anolilab/semantic-release-pnpm": "^1.1.3",
|
|
69
69
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
70
|
-
"@arethetypeswrong/cli": "^0.
|
|
70
|
+
"@arethetypeswrong/cli": "^0.16.2",
|
|
71
71
|
"@babel/core": "^7.25.2",
|
|
72
72
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
73
73
|
"@types/node": "18.19.15",
|
|
74
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
74
|
+
"@visulima/packem": "^1.0.0-alpha.108",
|
|
75
75
|
"@vitest/coverage-v8": "^2.0.5",
|
|
76
76
|
"@vitest/ui": "^2.0.5",
|
|
77
77
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var W=Object.defineProperty;var a=(i,t)=>W(i,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=String.prototype.replace,H=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"},J={RFC1738:a(function(i){return G.call(i,H,"+")},"RFC1738"),RFC3986:a(function(i){return String(i)},"RFC3986")},_=I.RFC1738,L=I.RFC3986,X=Array.isArray,p=function(){const i=[];for(let t=0;t<256;++t)i.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return i}(),A=1024,Y=a(function(t,r,e,o,y){if(t.length===0)return t;let g=t;if(typeof t=="symbol"?g=Symbol.prototype.toString.call(t):typeof t!="string"&&(g=String(t)),e==="iso-8859-1")return escape(g).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});let m="";for(let h=0;h<g.length;h+=A){const u=g.length>=A?g.slice(h,h+A):g,l=[];for(let f=0;f<u.length;++f){let n=u.charCodeAt(f);if(n===45||n===46||n===95||n===126||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||y===_&&(n===40||n===41)){l[l.length]=u.charAt(f);continue}if(n<128){l[l.length]=p[n];continue}if(n<2048){l[l.length]=p[192|n>>6]+p[128|n&63];continue}if(n<55296||n>=57344){l[l.length]=p[224|n>>12]+p[128|n>>6&63]+p[128|n&63];continue}f+=1,n=65536+((n&1023)<<10|u.charCodeAt(f)&1023),l[l.length]=p[240|n>>18]+p[128|n>>12&63]+p[128|n>>6&63]+p[128|n&63]}m+=l.join("")}return m},"encode"),Z=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),D=a(function(t,r){if(X(t)){const e=[];for(let o=0;o<t.length;o+=1)e.push(r(t[o]));return e}return r(t)},"maybeMap"),V={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},d=Array.isArray,tt=Array.prototype.push,K=a(function(i,t){tt.apply(i,d(t)?t:[t])},"pushToArray"),et=Date.prototype.toISOString,z=L,R={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Y,encodeValuesOnly:!1,format:z,formatter:J[z],indices:!1,serializeDate:a(function(t){return et.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},nt=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),E={},$=a(function(t,r,e,o,y,g,m,h,u,l,f,n,P,U,b,S,F,w){let s=t,N=w,C=0,B=!1;for(;(N=N.get(E))!==void 0&&!B;){const c=N.get(t);if(C+=1,typeof c<"u"){if(c===C)throw new RangeError("Cyclic object value");B=!0}typeof N.get(E)>"u"&&(C=0)}if(typeof l=="function"?s=l(r,s):s instanceof Date?s=P(s):e==="comma"&&d(s)&&(s=D(s,function(c){return c instanceof Date?P(c):c})),s===null){if(g)return u&&!S?u(r,R.encoder,F,"key",U):r;s=""}if(nt(s)||Z(s)){if(u){const c=S?r:u(r,R.encoder,F,"key",U);return[b(c)+"="+b(u(s,R.encoder,F,"value",U))]}return[b(r)+"="+b(String(s))]}const M=[];if(typeof s>"u")return M;let k;if(e==="comma"&&d(s))S&&u&&(s=D(s,u)),k=[{value:s.length>0?s.join(",")||null:void 0}];else if(d(l))k=l;else{const c=Object.keys(s);k=f?c.sort(f):c}const T=h?r.replace(/\./g,"%2E"):r,j=o&&d(s)&&s.length===1?T+"[]":T;if(y&&d(s)&&s.length===0)return j+"[]";for(let c=0;c<k.length;++c){const x=k[c],O=typeof x=="object"&&typeof x.value<"u"?x.value:s[x];if(m&&O===null)continue;const v=n&&h?x.replace(/\./g,"%2E"):x,Q=d(s)?typeof e=="function"?e(j,v):j:j+(n?"."+v:"["+v+"]");w.set(t,C);const q=new WeakMap;q.set(E,w),K(M,$(O,Q,e,o,y,g,m,h,e==="comma"&&S&&d(s)?null:u,l,f,n,P,U,b,S,F,q))}return M},"stringify"),rt=a(function(t){return R},"normalizeStringifyOptions");function st(i,t){let r=i;const e=rt();let o,y;typeof e.filter=="function"?(y=e.filter,r=y("",r)):d(e.filter)&&(y=e.filter,o=y);const g=[];if(typeof r!="object"||r===null)return"";const m=V[e.arrayFormat],h=m==="comma"&&e.commaRoundTrip;o||(o=Object.keys(r)),e.sort&&o.sort(e.sort);const u=new WeakMap;for(let n=0;n<o.length;++n){const P=o[n];e.skipNulls&&r[P]===null||K(g,$(r[P],P,m,h,e.allowEmptyArrays,e.strictNullHandling,e.skipNulls,e.encodeDotInKeys,e.encode?e.encoder:null,e.filter,e.sort,e.allowDots,e.serializeDate,e.format,e.formatter,e.encodeValuesOnly,e.charset,u))}const l=g.join(e.delimiter);let f=e.addQueryPrefix===!0?"?":"";return e.charsetSentinel&&(e.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}a(st,"stringify");var it=Object.defineProperty,ot=a((i,t)=>it(i,"name",{value:t,configurable:!0}),"n");class lt extends Array{static{a(this,"g")}constructor(t,r,e,...o){super(...o),this.totalNumber=t,this.perPage=r,this.currentPage=e,this.totalNumber=Number(t),this.rows=o,this.isEmpty=this.rows.length===0}static{ot(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(t){return this.url=t,this}getMeta(){return{firstPage:this.firstPage,firstPageUrl:this.getUrl(1),lastPage:this.lastPage,lastPageUrl:this.getUrl(this.lastPage),nextPageUrl:this.getNextPageUrl(),page:this.currentPage,perPage:this.perPage,previousPageUrl:this.getPreviousPageUrl(),total:this.total}}getNextPageUrl(){return this.hasMorePages?this.getUrl(this.currentPage+1):null}getPreviousPageUrl(){return this.currentPage>1?this.getUrl(this.currentPage-1):null}getUrl(t){const r=st({...this.qs,page:t<1?1:t});return`${this.url}?${r}`}getUrlsForRange(t,r){const e=[];for(let o=t;o<=r;o++)e.push({isActive:o===this.currentPage,page:o,url:this.getUrl(o)});return e}queryString(t){return this.qs=t,this}toJSON(){return{data:this.all(),meta:this.getMeta()}}get hasMorePages(){return this.lastPage>this.currentPage}get hasPages(){return this.lastPage!==1}get hasTotal(){return this.total>0}get lastPage(){return Math.max(Math.ceil(this.total/this.perPage),1)}get total(){return Number(this.totalNumber)}}exports.g=lt;
|
|
File without changes
|