@visulima/pagination 3.0.23 → 3.0.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pagination",
3
- "version": "3.0.23",
3
+ "version": "3.0.25",
4
4
  "description": "Simple Pagination for Node.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -65,18 +65,18 @@
65
65
  "devDependencies": {
66
66
  "@anolilab/eslint-config": "^15.0.3",
67
67
  "@anolilab/prettier-config": "^5.0.14",
68
- "@anolilab/semantic-release-pnpm": "^1.1.3",
69
- "@anolilab/semantic-release-preset": "^9.0.0",
70
- "@arethetypeswrong/cli": "^0.16.4",
71
- "@babel/core": "^7.25.7",
68
+ "@anolilab/semantic-release-pnpm": "^1.1.6",
69
+ "@anolilab/semantic-release-preset": "^9.0.3",
70
+ "@arethetypeswrong/cli": "^0.17.2",
71
+ "@babel/core": "^7.26.0",
72
72
  "@rushstack/eslint-plugin-security": "^0.8.3",
73
73
  "@types/node": "18.19.15",
74
- "@visulima/packem": "1.0.7",
75
- "@vitest/coverage-v8": "^2.1.2",
76
- "@vitest/ui": "^2.1.2",
74
+ "@visulima/packem": "1.10.7",
75
+ "@vitest/coverage-v8": "^2.1.8",
76
+ "@vitest/ui": "^2.1.8",
77
77
  "conventional-changelog-conventionalcommits": "8.0.0",
78
78
  "cross-env": "^7.0.3",
79
- "esbuild": "0.24.0",
79
+ "esbuild": "0.24.2",
80
80
  "eslint": "8.57.0",
81
81
  "eslint-plugin-deprecation": "^3.0.0",
82
82
  "eslint-plugin-etc": "^2.0.3",
@@ -85,15 +85,15 @@
85
85
  "eslint-plugin-vitest": "^0.4.1",
86
86
  "eslint-plugin-vitest-globals": "^1.5.0",
87
87
  "openapi-types": "^12.1.3",
88
- "prettier": "^3.3.3",
88
+ "prettier": "^3.4.2",
89
89
  "qs-esm": "^7.0.2",
90
- "rimraf": "5.0.9",
91
- "semantic-release": "24.0.0",
92
- "typescript": "5.4.5",
93
- "vitest": "^2.1.2"
90
+ "rimraf": "6.0.1",
91
+ "semantic-release": "24.2.1",
92
+ "typescript": "5.7.3",
93
+ "vitest": "^2.1.8"
94
94
  },
95
95
  "engines": {
96
- "node": ">=18.* <=22.*"
96
+ "node": ">=18.* <=23.*"
97
97
  },
98
98
  "os": [
99
99
  "darwin",
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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};
@@ -1 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var a=(e,t)=>n(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=Object.defineProperty,i=a((e,t)=>o(e,"name",{value:t,configurable:!0}),"r");const p=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"),s=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");exports.createPaginationMetaSchemaObject=p;exports.createPaginationSchemaObject=s;