@visulima/pagination 3.0.24 → 3.0.26

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.24",
3
+ "version": "3.0.26",
4
4
  "description": "Simple Pagination for Node.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -62,38 +62,8 @@
62
62
  "CHANGELOG.md",
63
63
  "LICENSE.md"
64
64
  ],
65
- "devDependencies": {
66
- "@anolilab/eslint-config": "^15.0.3",
67
- "@anolilab/prettier-config": "^5.0.14",
68
- "@anolilab/semantic-release-pnpm": "^1.1.5",
69
- "@anolilab/semantic-release-preset": "^9.0.2",
70
- "@arethetypeswrong/cli": "^0.17.1",
71
- "@babel/core": "^7.26.0",
72
- "@rushstack/eslint-plugin-security": "^0.8.3",
73
- "@types/node": "18.19.15",
74
- "@visulima/packem": "1.9.2",
75
- "@vitest/coverage-v8": "^2.1.8",
76
- "@vitest/ui": "^2.1.8",
77
- "conventional-changelog-conventionalcommits": "8.0.0",
78
- "cross-env": "^7.0.3",
79
- "esbuild": "0.24.0",
80
- "eslint": "8.57.0",
81
- "eslint-plugin-deprecation": "^3.0.0",
82
- "eslint-plugin-etc": "^2.0.3",
83
- "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
84
- "eslint-plugin-mdx": "^3.1.5",
85
- "eslint-plugin-vitest": "^0.4.1",
86
- "eslint-plugin-vitest-globals": "^1.5.0",
87
- "openapi-types": "^12.1.3",
88
- "prettier": "^3.4.2",
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.8"
94
- },
95
65
  "engines": {
96
- "node": ">=18.* <=23.*"
66
+ "node": ">=18.0.0 <=23.x"
97
67
  },
98
68
  "os": [
99
69
  "darwin",
@@ -103,34 +73,5 @@
103
73
  "publishConfig": {
104
74
  "access": "public",
105
75
  "provenance": true
106
- },
107
- "anolilab": {
108
- "eslint-config": {
109
- "plugin": {
110
- "tsdoc": false
111
- },
112
- "warn_on_unsupported_typescript_version": false,
113
- "info_on_disabling_jsx_react_rule": false,
114
- "info_on_disabling_prettier_conflict_rule": false,
115
- "info_on_disabling_jsonc_sort_keys_rule": false,
116
- "info_on_disabling_etc_no_deprecated": false
117
- }
118
- },
119
- "scripts": {
120
- "build": "cross-env NODE_ENV=development packem build",
121
- "build:prod": "cross-env NODE_ENV=production packem build",
122
- "clean": "rimraf node_modules dist .eslintcache",
123
- "dev": "pnpm run build --watch",
124
- "lint:attw": "attw --pack",
125
- "lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
126
- "lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
127
- "lint:package-json": "publint --strict",
128
- "lint:prettier": "prettier --config=.prettierrc.cjs --check .",
129
- "lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
130
- "lint:types": "tsc --noEmit",
131
- "test": "vitest run",
132
- "test:coverage": "vitest run --coverage",
133
- "test:ui": "vitest --ui --coverage.enabled=true",
134
- "test:watch": "vitest"
135
76
  }
136
77
  }
@@ -1 +0,0 @@
1
- var Y=Object.defineProperty;var w=(t,e)=>Y(t,"name",{value:e,configurable:!0});var Z=Object.defineProperty,H=w((t,e)=>Z(t,"name",{value:e,configurable:!0}),"e");const tt=String.prototype.replace,et=/%20/g,q={RFC1738:"RFC1738",RFC3986:"RFC3986"},K={RFC1738:H(function(t){return tt.call(t,et,"+")},"RFC1738"),RFC3986:H(function(t){return String(t)},"RFC3986")},rt=q.RFC1738,W=q.RFC3986;var ot=Object.defineProperty,h=w((t,e)=>ot(t,"name",{value:e,configurable:!0}),"u$1");const k=Object.prototype.hasOwnProperty,O=Array.isArray,d=function(){const t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),nt=h(function(t){for(;t.length>1;){const e=t.pop(),o=e.obj[e.prop];if(O(o)){const r=[];for(let a=0;a<o.length;++a)typeof o[a]<"u"&&r.push(o[a]);e.obj[e.prop]=r}}},"compactQueue"),it=h(function(t,e){const o=e&&e.plainObjects?Object.create(null):{};for(let r=0;r<t.length;++r)typeof t[r]<"u"&&(o[r]=t[r]);return o},"arrayToObject");h(w(function t(e,o,r){if(!o)return e;if(typeof o!="object"){if(O(e))e.push(o);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!k.call(Object.prototype,o))&&(e[o]=!0);else return[e,o];return e}if(!e||typeof e!="object")return[e].concat(o);let a=e;return O(e)&&!O(o)&&(a=it(e,r)),O(e)&&O(o)?(o.forEach(function(n,s){if(k.call(e,s)){const c=e[s];c&&typeof c=="object"&&n&&typeof n=="object"?e[s]=t(c,n,r):e.push(n)}else e[s]=n}),e):Object.keys(o).reduce(function(n,s){const c=o[s];return k.call(n,s)?n[s]=t(n[s],c,r):n[s]=c,n},a)},"i"),"merge");h(function(t,e){return Object.keys(e).reduce(function(o,r){return o[r]=e[r],o},t)},"assignSingleSource");h(function(t,e,o){const r=t.replace(/\+/g," ");if(o==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},"decode");const I=1024,at=h(function(t,e,o,r,a){if(t.length===0)return t;let n=t;if(typeof t=="symbol"?n=Symbol.prototype.toString.call(t):typeof t!="string"&&(n=String(t)),o==="iso-8859-1")return escape(n).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});let s="";for(let c=0;c<n.length;c+=I){const p=n.length>=I?n.slice(c,c+I):n,u=[];for(let g=0;g<p.length;++g){let i=p.charCodeAt(g);if(i===45||i===46||i===95||i===126||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||a===rt&&(i===40||i===41)){u[u.length]=p.charAt(g);continue}if(i<128){u[u.length]=d[i];continue}if(i<2048){u[u.length]=d[192|i>>6]+d[128|i&63];continue}if(i<55296||i>=57344){u[u.length]=d[224|i>>12]+d[128|i>>6&63]+d[128|i&63];continue}g+=1,i=65536+((i&1023)<<10|p.charCodeAt(g)&1023),u[u.length]=d[240|i>>18]+d[128|i>>12&63]+d[128|i>>6&63]+d[128|i&63]}s+=u.join("")}return s},"encode");h(function(t){const e=[{obj:{o:t},prop:"o"}],o=[];for(let r=0;r<e.length;++r){const a=e[r],n=a.obj[a.prop],s=Object.keys(n);for(let c=0;c<s.length;++c){const p=s[c],u=n[p];typeof u=="object"&&u!==null&&o.indexOf(u)===-1&&(e.push({obj:n,prop:p}),o.push(u))}}return nt(e),t},"compact");h(function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},"isRegExp");const lt=h(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer");h(function(t,e){return[].concat(t,e)},"combine");const V=h(function(t,e){if(O(t)){const o=[];for(let r=0;r<t.length;r+=1)o.push(e(t[r]));return o}return e(t)},"maybeMap");var st=Object.defineProperty,b=w((t,e)=>st(t,"name",{value:e,configurable:!0}),"u");const ct=Object.prototype.hasOwnProperty,J={brackets:b(function(t){return t+"[]"},"brackets"),comma:"comma",indices:b(function(t,e){return t+"["+e+"]"},"indices"),repeat:b(function(t){return t},"repeat")},m=Array.isArray,ut=Array.prototype.push,G=b(function(t,e){ut.apply(t,m(e)?e:[e])},"pushToArray"),ft=Date.prototype.toISOString,$=W,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:at,encodeValuesOnly:!1,format:$,formatter:K[$],indices:!1,serializeDate:b(function(t){return ft.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},pt=b(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),T={},_=b(function(t,e,o,r,a,n,s,c,p,u,g,i,j,P,E,N,D,C){let l=t,A=C,U=0,M=!1;for(;(A=A.get(T))!==void 0&&!M;){const y=A.get(t);if(U+=1,typeof y<"u"){if(y===U)throw new RangeError("Cyclic object value");M=!0}typeof A.get(T)>"u"&&(U=0)}if(typeof u=="function"?l=u(e,l):l instanceof Date?l=j(l):o==="comma"&&m(l)&&(l=V(l,function(y){return y instanceof Date?j(y):y})),l===null){if(n)return p&&!N?p(e,f.encoder,D,"key",P):e;l=""}if(pt(l)||lt(l)){if(p){const y=N?e:p(e,f.encoder,D,"key",P);return[E(y)+"="+E(p(l,f.encoder,D,"value",P))]}return[E(e)+"="+E(String(l))]}const S=[];if(typeof l>"u")return S;let R;if(o==="comma"&&m(l))N&&p&&(l=V(l,p)),R=[{value:l.length>0?l.join(",")||null:void 0}];else if(m(u))R=u;else{const y=Object.keys(l);R=g?y.sort(g):y}const z=c?e.replace(/\./g,"%2E"):e,F=r&&m(l)&&l.length===1?z+"[]":z;if(a&&m(l)&&l.length===0)return F+"[]";for(let y=0;y<R.length;++y){const v=R[y],Q=typeof v=="object"&&typeof v.value<"u"?v.value:l[v];if(s&&Q===null)continue;const x=i&&c?v.replace(/\./g,"%2E"):v,X=m(l)?typeof o=="function"?o(F,x):F:F+(i?"."+x:"["+x+"]");C.set(t,U);const B=new WeakMap;B.set(T,C),G(S,_(Q,X,o,r,a,n,s,c,o==="comma"&&N&&m(l)?null:p,u,g,i,j,P,E,N,D,B))}return S},"stringify"),yt=b(function(t){if(!t)return f;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");const e=t.charset||f.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let o=W;if(typeof t.format<"u"){if(!ct.call(K,t.format))throw new TypeError("Unknown format option provided.");o=t.format}const r=K[o];let a=f.filter;(typeof t.filter=="function"||m(t.filter))&&(a=t.filter);let n;if(t.arrayFormat in J?n=t.arrayFormat:"indices"in t?n=t.indices?"indices":"repeat":n=f.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const s=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:f.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:f.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:n,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:f.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?f.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:f.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:f.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:f.encodeValuesOnly,filter:a,format:o,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:f.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:f.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:f.strictNullHandling}},"normalizeStringifyOptions");function L(t,e){let o=t;const r=yt(e);let a,n;typeof r.filter=="function"?(n=r.filter,o=n("",o)):m(r.filter)&&(n=r.filter,a=n);const s=[];if(typeof o!="object"||o===null)return"";const c=J[r.arrayFormat],p=c==="comma"&&r.commaRoundTrip;a||(a=Object.keys(o)),r.sort&&a.sort(r.sort);const u=new WeakMap;for(let j=0;j<a.length;++j){const P=a[j];r.skipNulls&&o[P]===null||G(s,_(o[P],P,c,p,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}const g=s.join(r.delimiter);let i=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?i+="utf8=%26%2310003%3B&":i+="utf8=%E2%9C%93&"),g.length>0?i+g:""}w(L,"stringify");b(L,"stringify");var gt=Object.defineProperty,ht=w((t,e)=>gt(t,"name",{value:e,configurable:!0}),"n");class mt extends Array{static{w(this,"g")}constructor(e,o,r,...a){super(...a),this.totalNumber=e,this.perPage=o,this.currentPage=r,this.totalNumber=Number(e),this.rows=a,this.isEmpty=this.rows.length===0}static{ht(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(e){return this.url=e,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(e){const o=L({...this.qs,page:e<1?1:e});return`${this.url}?${o}`}getUrlsForRange(e,o){const r=[];for(let a=e;a<=o;a++)r.push({isActive:a===this.currentPage,page:a,url:this.getUrl(a)});return r}queryString(e){return this.qs=e,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{mt as default};
@@ -1 +0,0 @@
1
- "use strict";var Y=Object.defineProperty;var w=(t,e)=>Y(t,"name",{value:e,configurable:!0});var Z=Object.defineProperty,H=w((t,e)=>Z(t,"name",{value:e,configurable:!0}),"e");const tt=String.prototype.replace,et=/%20/g,q={RFC1738:"RFC1738",RFC3986:"RFC3986"},K={RFC1738:H(function(t){return tt.call(t,et,"+")},"RFC1738"),RFC3986:H(function(t){return String(t)},"RFC3986")},rt=q.RFC1738,W=q.RFC3986;var ot=Object.defineProperty,h=w((t,e)=>ot(t,"name",{value:e,configurable:!0}),"u$1");const k=Object.prototype.hasOwnProperty,O=Array.isArray,d=function(){const t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),nt=h(function(t){for(;t.length>1;){const e=t.pop(),o=e.obj[e.prop];if(O(o)){const r=[];for(let a=0;a<o.length;++a)typeof o[a]<"u"&&r.push(o[a]);e.obj[e.prop]=r}}},"compactQueue"),it=h(function(t,e){const o=e&&e.plainObjects?Object.create(null):{};for(let r=0;r<t.length;++r)typeof t[r]<"u"&&(o[r]=t[r]);return o},"arrayToObject");h(w(function t(e,o,r){if(!o)return e;if(typeof o!="object"){if(O(e))e.push(o);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!k.call(Object.prototype,o))&&(e[o]=!0);else return[e,o];return e}if(!e||typeof e!="object")return[e].concat(o);let a=e;return O(e)&&!O(o)&&(a=it(e,r)),O(e)&&O(o)?(o.forEach(function(n,s){if(k.call(e,s)){const c=e[s];c&&typeof c=="object"&&n&&typeof n=="object"?e[s]=t(c,n,r):e.push(n)}else e[s]=n}),e):Object.keys(o).reduce(function(n,s){const c=o[s];return k.call(n,s)?n[s]=t(n[s],c,r):n[s]=c,n},a)},"i"),"merge");h(function(t,e){return Object.keys(e).reduce(function(o,r){return o[r]=e[r],o},t)},"assignSingleSource");h(function(t,e,o){const r=t.replace(/\+/g," ");if(o==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},"decode");const I=1024,at=h(function(t,e,o,r,a){if(t.length===0)return t;let n=t;if(typeof t=="symbol"?n=Symbol.prototype.toString.call(t):typeof t!="string"&&(n=String(t)),o==="iso-8859-1")return escape(n).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});let s="";for(let c=0;c<n.length;c+=I){const p=n.length>=I?n.slice(c,c+I):n,u=[];for(let g=0;g<p.length;++g){let i=p.charCodeAt(g);if(i===45||i===46||i===95||i===126||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||a===rt&&(i===40||i===41)){u[u.length]=p.charAt(g);continue}if(i<128){u[u.length]=d[i];continue}if(i<2048){u[u.length]=d[192|i>>6]+d[128|i&63];continue}if(i<55296||i>=57344){u[u.length]=d[224|i>>12]+d[128|i>>6&63]+d[128|i&63];continue}g+=1,i=65536+((i&1023)<<10|p.charCodeAt(g)&1023),u[u.length]=d[240|i>>18]+d[128|i>>12&63]+d[128|i>>6&63]+d[128|i&63]}s+=u.join("")}return s},"encode");h(function(t){const e=[{obj:{o:t},prop:"o"}],o=[];for(let r=0;r<e.length;++r){const a=e[r],n=a.obj[a.prop],s=Object.keys(n);for(let c=0;c<s.length;++c){const p=s[c],u=n[p];typeof u=="object"&&u!==null&&o.indexOf(u)===-1&&(e.push({obj:n,prop:p}),o.push(u))}}return nt(e),t},"compact");h(function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},"isRegExp");const lt=h(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer");h(function(t,e){return[].concat(t,e)},"combine");const V=h(function(t,e){if(O(t)){const o=[];for(let r=0;r<t.length;r+=1)o.push(e(t[r]));return o}return e(t)},"maybeMap");var st=Object.defineProperty,b=w((t,e)=>st(t,"name",{value:e,configurable:!0}),"u");const ct=Object.prototype.hasOwnProperty,J={brackets:b(function(t){return t+"[]"},"brackets"),comma:"comma",indices:b(function(t,e){return t+"["+e+"]"},"indices"),repeat:b(function(t){return t},"repeat")},m=Array.isArray,ut=Array.prototype.push,G=b(function(t,e){ut.apply(t,m(e)?e:[e])},"pushToArray"),ft=Date.prototype.toISOString,$=W,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:at,encodeValuesOnly:!1,format:$,formatter:K[$],indices:!1,serializeDate:b(function(t){return ft.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},pt=b(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),T={},_=b(function(t,e,o,r,a,n,s,c,p,u,g,i,j,P,E,N,D,C){let l=t,A=C,U=0,M=!1;for(;(A=A.get(T))!==void 0&&!M;){const y=A.get(t);if(U+=1,typeof y<"u"){if(y===U)throw new RangeError("Cyclic object value");M=!0}typeof A.get(T)>"u"&&(U=0)}if(typeof u=="function"?l=u(e,l):l instanceof Date?l=j(l):o==="comma"&&m(l)&&(l=V(l,function(y){return y instanceof Date?j(y):y})),l===null){if(n)return p&&!N?p(e,f.encoder,D,"key",P):e;l=""}if(pt(l)||lt(l)){if(p){const y=N?e:p(e,f.encoder,D,"key",P);return[E(y)+"="+E(p(l,f.encoder,D,"value",P))]}return[E(e)+"="+E(String(l))]}const S=[];if(typeof l>"u")return S;let R;if(o==="comma"&&m(l))N&&p&&(l=V(l,p)),R=[{value:l.length>0?l.join(",")||null:void 0}];else if(m(u))R=u;else{const y=Object.keys(l);R=g?y.sort(g):y}const z=c?e.replace(/\./g,"%2E"):e,F=r&&m(l)&&l.length===1?z+"[]":z;if(a&&m(l)&&l.length===0)return F+"[]";for(let y=0;y<R.length;++y){const v=R[y],Q=typeof v=="object"&&typeof v.value<"u"?v.value:l[v];if(s&&Q===null)continue;const x=i&&c?v.replace(/\./g,"%2E"):v,X=m(l)?typeof o=="function"?o(F,x):F:F+(i?"."+x:"["+x+"]");C.set(t,U);const B=new WeakMap;B.set(T,C),G(S,_(Q,X,o,r,a,n,s,c,o==="comma"&&N&&m(l)?null:p,u,g,i,j,P,E,N,D,B))}return S},"stringify"),yt=b(function(t){if(!t)return f;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");const e=t.charset||f.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let o=W;if(typeof t.format<"u"){if(!ct.call(K,t.format))throw new TypeError("Unknown format option provided.");o=t.format}const r=K[o];let a=f.filter;(typeof t.filter=="function"||m(t.filter))&&(a=t.filter);let n;if(t.arrayFormat in J?n=t.arrayFormat:"indices"in t?n=t.indices?"indices":"repeat":n=f.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const s=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:f.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:f.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:n,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:f.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?f.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:f.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:f.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:f.encodeValuesOnly,filter:a,format:o,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:f.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:f.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:f.strictNullHandling}},"normalizeStringifyOptions");function L(t,e){let o=t;const r=yt(e);let a,n;typeof r.filter=="function"?(n=r.filter,o=n("",o)):m(r.filter)&&(n=r.filter,a=n);const s=[];if(typeof o!="object"||o===null)return"";const c=J[r.arrayFormat],p=c==="comma"&&r.commaRoundTrip;a||(a=Object.keys(o)),r.sort&&a.sort(r.sort);const u=new WeakMap;for(let j=0;j<a.length;++j){const P=a[j];r.skipNulls&&o[P]===null||G(s,_(o[P],P,c,p,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}const g=s.join(r.delimiter);let i=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?i+="utf8=%26%2310003%3B&":i+="utf8=%E2%9C%93&"),g.length>0?i+g:""}w(L,"stringify");b(L,"stringify");var gt=Object.defineProperty,ht=w((t,e)=>gt(t,"name",{value:e,configurable:!0}),"n");class dt extends Array{static{w(this,"g")}constructor(e,o,r,...a){super(...a),this.totalNumber=e,this.perPage=o,this.currentPage=r,this.totalNumber=Number(e),this.rows=a,this.isEmpty=this.rows.length===0}static{ht(this,"Paginator")}firstPage=1;isEmpty;qs={};rows;url="/";all(){return this.rows}baseUrl(e){return this.url=e,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(e){const o=L({...this.qs,page:e<1?1:e});return`${this.url}?${o}`}getUrlsForRange(e,o){const r=[];for(let a=e;a<=o;a++)r.push({isActive:a===this.currentPage,page:a,url:this.getUrl(a)});return r}queryString(e){return this.qs=e,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=dt;
@@ -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;