@gustavo-valsechi/node 1.0.41 → 1.0.42

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/dist/index.js CHANGED
@@ -192,7 +192,7 @@ var parse = (json) => {
192
192
  return json;
193
193
  };
194
194
  var OptionsSchema = import_zod2.z.object({
195
- take: import_zod2.z.number().max(200).default(20),
195
+ take: import_zod2.z.number().default(20),
196
196
  page: import_zod2.z.number().default(0),
197
197
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
198
198
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
@@ -209,7 +209,7 @@ var paginate = async (repository, options) => {
209
209
  ...params
210
210
  });
211
211
  return {
212
- totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : 1,
212
+ totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : data.length ? 1 : 0,
213
213
  total: count,
214
214
  content: data
215
215
  };
package/dist/index.mjs CHANGED
@@ -161,7 +161,7 @@ var parse = (json) => {
161
161
  return json;
162
162
  };
163
163
  var OptionsSchema = z.object({
164
- take: z.number().max(200).default(20),
164
+ take: z.number().default(20),
165
165
  page: z.number().default(0),
166
166
  select: z.array(z.string()).optional(),
167
167
  relations: z.array(z.string()).optional(),
@@ -178,7 +178,7 @@ var paginate = async (repository, options) => {
178
178
  ...params
179
179
  });
180
180
  return {
181
- totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : 1,
181
+ totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : data.length ? 1 : 0,
182
182
  total: count,
183
183
  content: data
184
184
  };
@@ -144,7 +144,7 @@ var parse = (json) => {
144
144
  return json;
145
145
  };
146
146
  var OptionsSchema = import_zod2.z.object({
147
- take: import_zod2.z.number().max(200).default(20),
147
+ take: import_zod2.z.number().default(20),
148
148
  page: import_zod2.z.number().default(0),
149
149
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
150
150
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
@@ -118,7 +118,7 @@ var parse = (json) => {
118
118
  return json;
119
119
  };
120
120
  var OptionsSchema = z.object({
121
- take: z.number().max(200).default(20),
121
+ take: z.number().default(20),
122
122
  page: z.number().default(0),
123
123
  select: z.array(z.string()).optional(),
124
124
  relations: z.array(z.string()).optional(),
@@ -121,7 +121,7 @@ var parse = (json) => {
121
121
  return json;
122
122
  };
123
123
  var OptionsSchema = import_zod.z.object({
124
- take: import_zod.z.number().max(200).default(20),
124
+ take: import_zod.z.number().default(20),
125
125
  page: import_zod.z.number().default(0),
126
126
  select: import_zod.z.array(import_zod.z.string()).optional(),
127
127
  relations: import_zod.z.array(import_zod.z.string()).optional(),
@@ -96,7 +96,7 @@ var parse = (json) => {
96
96
  return json;
97
97
  };
98
98
  var OptionsSchema = z.object({
99
- take: z.number().max(200).default(20),
99
+ take: z.number().default(20),
100
100
  page: z.number().default(0),
101
101
  select: z.array(z.string()).optional(),
102
102
  relations: z.array(z.string()).optional(),
@@ -145,7 +145,7 @@ var parse = (json) => {
145
145
  return json;
146
146
  };
147
147
  var OptionsSchema = import_zod2.z.object({
148
- take: import_zod2.z.number().max(200).default(20),
148
+ take: import_zod2.z.number().default(20),
149
149
  page: import_zod2.z.number().default(0),
150
150
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
151
151
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
@@ -121,7 +121,7 @@ var parse = (json) => {
121
121
  return json;
122
122
  };
123
123
  var OptionsSchema = z.object({
124
- take: z.number().max(200).default(20),
124
+ take: z.number().default(20),
125
125
  page: z.number().default(0),
126
126
  select: z.array(z.string()).optional(),
127
127
  relations: z.array(z.string()).optional(),
@@ -149,7 +149,7 @@ var parse = (json) => {
149
149
  return json;
150
150
  };
151
151
  var OptionsSchema = import_zod2.z.object({
152
- take: import_zod2.z.number().max(200).default(20),
152
+ take: import_zod2.z.number().default(20),
153
153
  page: import_zod2.z.number().default(0),
154
154
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
155
155
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
@@ -166,7 +166,7 @@ var paginate = async (repository, options) => {
166
166
  ...params
167
167
  });
168
168
  return {
169
- totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : 1,
169
+ totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : data.length ? 1 : 0,
170
170
  total: count,
171
171
  content: data
172
172
  };
@@ -125,7 +125,7 @@ var parse = (json) => {
125
125
  return json;
126
126
  };
127
127
  var OptionsSchema = z.object({
128
- take: z.number().max(200).default(20),
128
+ take: z.number().default(20),
129
129
  page: z.number().default(0),
130
130
  select: z.array(z.string()).optional(),
131
131
  relations: z.array(z.string()).optional(),
@@ -142,7 +142,7 @@ var paginate = async (repository, options) => {
142
142
  ...params
143
143
  });
144
144
  return {
145
- totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : 1,
145
+ totalPage: options.take ? Math.ceil(count / options.take) : (_a = options.take) != null ? _a : data.length ? 1 : 0,
146
146
  total: count,
147
147
  content: data
148
148
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/node",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",