@wener/common 1.0.5 → 2.0.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 (152) hide show
  1. package/lib/cn/DivisionCode.js +55 -32
  2. package/lib/cn/DivisionCode.test.js +140 -0
  3. package/lib/cn/Mod11Checksum.js +80 -37
  4. package/lib/cn/Mod31Checksum.js +89 -40
  5. package/lib/cn/ResidentIdentityCardNumber.js +16 -16
  6. package/lib/cn/ResidentIdentityCardNumber.test.js +21 -0
  7. package/lib/cn/UnifiedSocialCreditCode.js +32 -26
  8. package/lib/cn/UnifiedSocialCreditCode.test.js +16 -0
  9. package/lib/cn/formatDate.js +5 -7
  10. package/lib/cn/index.js +0 -1
  11. package/lib/cn/parseSex.js +0 -2
  12. package/lib/cn/types.d.js +0 -2
  13. package/lib/consola/createStandardConsolaReporter.js +6 -6
  14. package/lib/consola/formatLogObject.js +133 -32
  15. package/lib/consola/index.js +0 -1
  16. package/lib/data/formatSort.js +5 -6
  17. package/lib/data/formatSort.test.js +34 -0
  18. package/lib/data/index.js +0 -1
  19. package/lib/data/maybeNumber.js +11 -5
  20. package/lib/data/parseSort.js +28 -22
  21. package/lib/data/parseSort.test.js +188 -0
  22. package/lib/data/resolvePagination.js +27 -16
  23. package/lib/data/resolvePagination.test.js +232 -0
  24. package/lib/data/types.d.js +0 -2
  25. package/lib/index.js +0 -1
  26. package/lib/jsonschema/JsonSchema.js +78 -52
  27. package/lib/jsonschema/JsonSchema.test.js +137 -0
  28. package/lib/jsonschema/index.js +0 -1
  29. package/lib/jsonschema/types.d.js +5 -3
  30. package/lib/meta/defineFileType.js +103 -20
  31. package/lib/meta/defineInit.js +250 -31
  32. package/lib/meta/defineMetadata.js +140 -24
  33. package/lib/meta/defineMetadata.test.js +13 -0
  34. package/lib/meta/index.js +0 -1
  35. package/lib/password/PHC.js +87 -63
  36. package/lib/password/PHC.test.js +539 -0
  37. package/lib/password/Password.js +291 -29
  38. package/lib/password/Password.test.js +362 -0
  39. package/lib/password/createArgon2PasswordAlgorithm.js +191 -35
  40. package/lib/password/createBase64PasswordAlgorithm.js +141 -8
  41. package/lib/password/createBcryptPasswordAlgorithm.js +168 -13
  42. package/lib/password/createPBKDF2PasswordAlgorithm.js +228 -46
  43. package/lib/password/createScryptPasswordAlgorithm.js +211 -55
  44. package/lib/password/index.js +0 -1
  45. package/lib/password/server/index.js +0 -1
  46. package/lib/resource/Identifiable.js +1 -0
  47. package/lib/resource/getTitleOfResource.js +10 -0
  48. package/lib/resource/index.js +1 -0
  49. package/lib/resource/schema/AnyResourceSchema.js +89 -0
  50. package/lib/resource/schema/BaseResourceSchema.js +29 -0
  51. package/lib/resource/schema/ResourceActionType.js +118 -0
  52. package/lib/resource/schema/ResourceStatus.js +93 -0
  53. package/lib/resource/schema/ResourceType.js +24 -0
  54. package/lib/resource/schema/SchemaRegistry.js +38 -0
  55. package/lib/resource/schema/SexType.js +10 -0
  56. package/lib/resource/schema/types.js +89 -0
  57. package/lib/resource/schema/types.test.js +14 -0
  58. package/lib/schema/TypeSchema.d.js +1 -0
  59. package/lib/schema/createSchemaData.js +173 -0
  60. package/lib/schema/findJsonSchemaByPath.js +49 -0
  61. package/lib/schema/getSchemaCache.js +11 -0
  62. package/lib/schema/getSchemaOptions.js +24 -0
  63. package/lib/schema/index.js +5 -0
  64. package/lib/schema/toJsonSchema.js +441 -0
  65. package/lib/schema/toJsonSchema.test.js +27 -0
  66. package/lib/schema/validate.js +124 -0
  67. package/lib/search/AdvanceSearch.js +0 -1
  68. package/lib/search/AdvanceSearch.test.js +435 -0
  69. package/lib/search/formatAdvanceSearch.js +41 -27
  70. package/lib/search/index.js +0 -1
  71. package/lib/search/optimizeAdvanceSearch.js +79 -25
  72. package/lib/search/parseAdvanceSearch.js +5 -5
  73. package/lib/search/parser.d.js +0 -2
  74. package/lib/search/parser.js +97 -74
  75. package/lib/search/types.d.js +0 -2
  76. package/lib/tools/generateSchema.js +197 -39
  77. package/lib/tools/renderJsonSchemaToMarkdownDoc.js +143 -55
  78. package/package.json +23 -11
  79. package/src/data/maybeNumber.ts +5 -1
  80. package/src/data/resolvePagination.test.ts +1 -1
  81. package/src/data/resolvePagination.ts +18 -7
  82. package/src/data/types.d.ts +12 -0
  83. package/src/jsonschema/JsonSchema.test.ts +17 -0
  84. package/src/jsonschema/JsonSchema.ts +2 -2
  85. package/src/jsonschema/types.d.ts +63 -12
  86. package/src/resource/Identifiable.ts +3 -0
  87. package/src/resource/getTitleOfResource.tsx +6 -0
  88. package/src/resource/index.ts +3 -0
  89. package/src/resource/schema/AnyResourceSchema.ts +113 -0
  90. package/src/resource/schema/BaseResourceSchema.ts +32 -0
  91. package/src/resource/schema/ResourceActionType.ts +123 -0
  92. package/src/resource/schema/ResourceStatus.ts +94 -0
  93. package/src/resource/schema/ResourceType.ts +25 -0
  94. package/src/resource/schema/SchemaRegistry.ts +42 -0
  95. package/src/resource/schema/SexType.ts +13 -0
  96. package/src/resource/schema/types.test.ts +18 -0
  97. package/src/resource/schema/types.ts +105 -0
  98. package/src/schema/TypeSchema.d.ts +32 -0
  99. package/src/schema/createSchemaData.ts +81 -0
  100. package/src/schema/findJsonSchemaByPath.ts +37 -0
  101. package/src/schema/getSchemaCache.ts +21 -0
  102. package/src/schema/getSchemaOptions.ts +24 -0
  103. package/src/schema/index.ts +6 -0
  104. package/src/schema/toJsonSchema.test.ts +37 -0
  105. package/src/schema/toJsonSchema.ts +200 -0
  106. package/src/schema/validate.ts +135 -0
  107. package/src/tools/generateSchema.ts +28 -28
  108. package/lib/cn/DivisionCode.js.map +0 -1
  109. package/lib/cn/Mod11Checksum.js.map +0 -1
  110. package/lib/cn/Mod31Checksum.js.map +0 -1
  111. package/lib/cn/ResidentIdentityCardNumber.js.map +0 -1
  112. package/lib/cn/UnifiedSocialCreditCode.js.map +0 -1
  113. package/lib/cn/formatDate.js.map +0 -1
  114. package/lib/cn/index.js.map +0 -1
  115. package/lib/cn/parseSex.js.map +0 -1
  116. package/lib/cn/types.d.js.map +0 -1
  117. package/lib/consola/createStandardConsolaReporter.js.map +0 -1
  118. package/lib/consola/formatLogObject.js.map +0 -1
  119. package/lib/consola/index.js.map +0 -1
  120. package/lib/data/formatSort.js.map +0 -1
  121. package/lib/data/index.js.map +0 -1
  122. package/lib/data/maybeNumber.js.map +0 -1
  123. package/lib/data/parseSort.js.map +0 -1
  124. package/lib/data/resolvePagination.js.map +0 -1
  125. package/lib/data/types.d.js.map +0 -1
  126. package/lib/index.js.map +0 -1
  127. package/lib/jsonschema/JsonSchema.js.map +0 -1
  128. package/lib/jsonschema/index.js.map +0 -1
  129. package/lib/jsonschema/types.d.js.map +0 -1
  130. package/lib/meta/defineFileType.js.map +0 -1
  131. package/lib/meta/defineInit.js.map +0 -1
  132. package/lib/meta/defineMetadata.js.map +0 -1
  133. package/lib/meta/index.js.map +0 -1
  134. package/lib/password/PHC.js.map +0 -1
  135. package/lib/password/Password.js.map +0 -1
  136. package/lib/password/createArgon2PasswordAlgorithm.js.map +0 -1
  137. package/lib/password/createBase64PasswordAlgorithm.js.map +0 -1
  138. package/lib/password/createBcryptPasswordAlgorithm.js.map +0 -1
  139. package/lib/password/createPBKDF2PasswordAlgorithm.js.map +0 -1
  140. package/lib/password/createScryptPasswordAlgorithm.js.map +0 -1
  141. package/lib/password/index.js.map +0 -1
  142. package/lib/password/server/index.js.map +0 -1
  143. package/lib/search/AdvanceSearch.js.map +0 -1
  144. package/lib/search/formatAdvanceSearch.js.map +0 -1
  145. package/lib/search/index.js.map +0 -1
  146. package/lib/search/optimizeAdvanceSearch.js.map +0 -1
  147. package/lib/search/parseAdvanceSearch.js.map +0 -1
  148. package/lib/search/parser.d.js.map +0 -1
  149. package/lib/search/parser.js.map +0 -1
  150. package/lib/search/types.d.js.map +0 -1
  151. package/lib/tools/generateSchema.js.map +0 -1
  152. package/lib/tools/renderJsonSchemaToMarkdownDoc.js.map +0 -1
@@ -0,0 +1,188 @@
1
+ import { describe, expect, test } from "vitest";
2
+ import { parseSort } from "./parseSort.js";
3
+ describe("parseSort", function () {
4
+ describe("basic parsing", function () {
5
+ test("handles empty inputs", function () {
6
+ expect(parseSort("")).toEqual([]);
7
+ expect(parseSort([])).toEqual([]);
8
+ expect(parseSort(null)).toEqual([]);
9
+ expect(parseSort(undefined)).toEqual([]);
10
+ });
11
+ test("handles simple field names", function () {
12
+ expect(parseSort("a")).toEqual([
13
+ {
14
+ field: "a",
15
+ order: "asc"
16
+ }
17
+ ]);
18
+ expect(parseSort([
19
+ "a"
20
+ ])).toEqual([
21
+ {
22
+ field: "a",
23
+ order: "asc"
24
+ }
25
+ ]);
26
+ expect(parseSort("a.b")).toEqual([
27
+ {
28
+ field: "a.b",
29
+ order: "asc"
30
+ }
31
+ ]);
32
+ });
33
+ test("handles prefix notation", function () {
34
+ expect(parseSort("-a")).toEqual([
35
+ {
36
+ field: "a",
37
+ order: "desc"
38
+ }
39
+ ]);
40
+ expect(parseSort("+b")).toEqual([
41
+ {
42
+ field: "b",
43
+ order: "asc"
44
+ }
45
+ ]);
46
+ expect(parseSort("-a,+b")).toEqual([
47
+ {
48
+ field: "a",
49
+ order: "desc"
50
+ },
51
+ {
52
+ field: "b",
53
+ order: "asc"
54
+ }
55
+ ]);
56
+ });
57
+ });
58
+ describe("explicit ordering", function () {
59
+ test("handles explicit order keywords", function () {
60
+ expect(parseSort("a asc")).toEqual([
61
+ {
62
+ field: "a",
63
+ order: "asc"
64
+ }
65
+ ]);
66
+ expect(parseSort("a desc")).toEqual([
67
+ {
68
+ field: "a",
69
+ order: "desc"
70
+ }
71
+ ]);
72
+ expect(parseSort("-a asc")).toEqual([
73
+ {
74
+ field: "a",
75
+ order: "asc"
76
+ }
77
+ ]); // explicit order overrides prefix
78
+ });
79
+ });
80
+ describe("nulls handling", function () {
81
+ test("handles nulls specification", function () {
82
+ expect(parseSort("a asc nulls last")).toEqual([
83
+ {
84
+ field: "a",
85
+ order: "asc",
86
+ nulls: "last"
87
+ }
88
+ ]);
89
+ expect(parseSort("a asc nulls first")).toEqual([
90
+ {
91
+ field: "a",
92
+ order: "asc",
93
+ nulls: "first"
94
+ }
95
+ ]);
96
+ expect(parseSort("a desc nulls last")).toEqual([
97
+ {
98
+ field: "a",
99
+ order: "desc",
100
+ nulls: "last"
101
+ }
102
+ ]);
103
+ expect(parseSort("a nulls first")).toEqual([
104
+ {
105
+ field: "a",
106
+ order: "asc",
107
+ nulls: "first"
108
+ }
109
+ ]);
110
+ expect(parseSort("-a nulls first")).toEqual([
111
+ {
112
+ field: "a",
113
+ order: "desc",
114
+ nulls: "first"
115
+ }
116
+ ]);
117
+ // Alternative syntax
118
+ expect(parseSort("a asc last")).toEqual([
119
+ {
120
+ field: "a",
121
+ order: "asc",
122
+ nulls: "last"
123
+ }
124
+ ]);
125
+ });
126
+ });
127
+ describe("object notation", function () {
128
+ test("handles object input", function () {
129
+ expect(parseSort([
130
+ {
131
+ field: "a",
132
+ order: "asc"
133
+ }
134
+ ])).toEqual([
135
+ {
136
+ field: "a",
137
+ order: "asc"
138
+ }
139
+ ]);
140
+ expect(parseSort([
141
+ {
142
+ field: "a",
143
+ order: "asc",
144
+ nulls: "last"
145
+ }
146
+ ])).toEqual([
147
+ {
148
+ field: "a",
149
+ order: "asc",
150
+ nulls: "last"
151
+ }
152
+ ]);
153
+ });
154
+ });
155
+ describe("invalid inputs", function () {
156
+ test("handles invalid inputs gracefully", function () {
157
+ expect(parseSort([
158
+ {
159
+ order: "asc"
160
+ }
161
+ ])).toEqual([]);
162
+ expect(parseSort([
163
+ "a,,",
164
+ {
165
+ field: "",
166
+ order: "asc"
167
+ }
168
+ ])).toEqual([
169
+ {
170
+ field: "a",
171
+ order: "asc"
172
+ }
173
+ ]);
174
+ expect(parseSort([
175
+ ",,",
176
+ {
177
+ field: "a",
178
+ order: "asc"
179
+ }
180
+ ])).toEqual([
181
+ {
182
+ field: "a",
183
+ order: "asc"
184
+ }
185
+ ]);
186
+ });
187
+ });
188
+ });
@@ -1,8 +1,9 @@
1
1
  import { maybeFunction } from "@wener/utils";
2
- import { clamp, mapValues, omitBy, pick } from "es-toolkit";
2
+ import { mapValues, omitBy, pick } from "es-toolkit";
3
3
  import { maybeNumber } from "./maybeNumber.js";
4
- export function resolvePagination(page, options = {}) {
5
- let out = omitBy(mapValues(//
4
+ export function resolvePagination(page) {
5
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6
+ var out = omitBy(mapValues(//
6
7
  pick(page, [
7
8
  "limit",
8
9
  "offset",
@@ -10,27 +11,37 @@ export function resolvePagination(page, options = {}) {
10
11
  "pageNumber",
11
12
  "pageIndex"
12
13
  ]), // to Number
13
- (v) => maybeNumber(v)), (v) => v === undefined || v === null);
14
- let { pageSize } = out;
14
+ function (v) {
15
+ return maybeNumber(v);
16
+ }), function (v) {
17
+ return v === undefined || v === null;
18
+ });
19
+ var pageSize = out.pageSize;
15
20
  if (options.pageSize) {
16
21
  pageSize = maybeFunction(options.pageSize, pageSize);
17
22
  }
18
- pageSize ??= 20;
19
- pageSize = clamp(pageSize, 1, options.maxPageSize ?? 1000);
20
- let { pageNumber = 1, pageIndex, limit, offset } = out;
23
+ pageSize !== null && pageSize !== void 0 ? pageSize : pageSize = resolvePagination.pageSize;
24
+ var _out_pageNumber = out.pageNumber, pageNumber = _out_pageNumber === void 0 ? 1 : _out_pageNumber, pageIndex = out.pageIndex;
21
25
  // page index over page number
22
26
  pageNumber = Math.max(pageNumber, 1);
23
- pageIndex = Math.max(pageIndex ?? pageNumber - 1, 0);
24
- limit = Math.max(1, limit ?? pageSize);
25
- offset = Math.max(0, offset ?? pageSize * pageIndex);
27
+ pageIndex = Math.max(pageIndex !== null && pageIndex !== void 0 ? pageIndex : pageNumber - 1, 0);
28
+ var _out_limit = out.limit, limit = _out_limit === void 0 ? pageSize : _out_limit, _out_offset = out.offset, offset = _out_offset === void 0 ? pageSize * pageIndex : _out_offset;
29
+ limit = Math.max(1, limit);
30
+ offset = Math.max(0, offset);
31
+ if (options.maxLimit) {
32
+ limit = Math.min(limit, options.maxLimit);
33
+ }
34
+ if (options.maxOffset) {
35
+ offset = Math.min(offset, options.maxOffset);
36
+ }
26
37
  pageSize = limit;
27
38
  pageIndex = Math.floor(offset / pageSize);
28
39
  return {
29
- limit,
30
- offset,
31
- pageSize,
40
+ limit: limit,
41
+ offset: offset,
42
+ pageSize: pageSize,
32
43
  pageNumber: pageIndex + 1,
33
- pageIndex
44
+ pageIndex: pageIndex
34
45
  };
35
46
  }
36
- //# sourceMappingURL=resolvePagination.js.map
47
+ resolvePagination.pageSize = 20;
@@ -0,0 +1,232 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length)
3
+ len = arr.length;
4
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
5
+ arr2[i] = arr[i];
6
+ return arr2;
7
+ }
8
+ function _array_with_holes(arr) {
9
+ if (Array.isArray(arr))
10
+ return arr;
11
+ }
12
+ function _iterable_to_array_limit(arr, i) {
13
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
14
+ if (_i == null)
15
+ return;
16
+ var _arr = [];
17
+ var _n = true;
18
+ var _d = false;
19
+ var _s, _e;
20
+ try {
21
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
22
+ _arr.push(_s.value);
23
+ if (i && _arr.length === i)
24
+ break;
25
+ }
26
+ }
27
+ catch (err) {
28
+ _d = true;
29
+ _e = err;
30
+ }
31
+ finally {
32
+ try {
33
+ if (!_n && _i["return"] != null)
34
+ _i["return"]();
35
+ }
36
+ finally {
37
+ if (_d)
38
+ throw _e;
39
+ }
40
+ }
41
+ return _arr;
42
+ }
43
+ function _non_iterable_rest() {
44
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
45
+ }
46
+ function _sliced_to_array(arr, i) {
47
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
48
+ }
49
+ function _unsupported_iterable_to_array(o, minLen) {
50
+ if (!o)
51
+ return;
52
+ if (typeof o === "string")
53
+ return _array_like_to_array(o, minLen);
54
+ var n = Object.prototype.toString.call(o).slice(8, -1);
55
+ if (n === "Object" && o.constructor)
56
+ n = o.constructor.name;
57
+ if (n === "Map" || n === "Set")
58
+ return Array.from(n);
59
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
60
+ return _array_like_to_array(o, minLen);
61
+ }
62
+ import { expect, test } from "vitest";
63
+ import { resolvePagination } from "./resolvePagination.js";
64
+ test(resolvePagination.name, function () {
65
+ var testCases = [
66
+ [
67
+ "pageSize with null pageIndex",
68
+ {
69
+ pageSize: "10",
70
+ pageIndex: null
71
+ },
72
+ {
73
+ limit: 10,
74
+ offset: 0,
75
+ pageSize: 10,
76
+ pageNumber: 1,
77
+ pageIndex: 0
78
+ }
79
+ ],
80
+ [
81
+ "pageSize with pageIndex",
82
+ {
83
+ pageSize: "10",
84
+ pageIndex: 1
85
+ },
86
+ {
87
+ limit: 10,
88
+ offset: 10,
89
+ pageSize: 10,
90
+ pageNumber: 2,
91
+ pageIndex: 1
92
+ }
93
+ ],
94
+ [
95
+ "pageSize with pageIndex 2",
96
+ {
97
+ pageSize: "10",
98
+ pageIndex: 2
99
+ },
100
+ {
101
+ limit: 10,
102
+ offset: 20,
103
+ pageSize: 10,
104
+ pageNumber: 3,
105
+ pageIndex: 2
106
+ }
107
+ ],
108
+ [
109
+ "limit with null offset",
110
+ {
111
+ limit: "10",
112
+ offset: null
113
+ },
114
+ {
115
+ limit: 10,
116
+ offset: 0,
117
+ pageSize: 10,
118
+ pageNumber: 1,
119
+ pageIndex: 0
120
+ }
121
+ ],
122
+ [
123
+ "limit with offset",
124
+ {
125
+ limit: "10",
126
+ offset: "20"
127
+ },
128
+ {
129
+ limit: 10,
130
+ offset: 20,
131
+ pageSize: 10,
132
+ pageNumber: 3,
133
+ pageIndex: 2
134
+ }
135
+ ],
136
+ [
137
+ "null limit with offset",
138
+ {
139
+ limit: null,
140
+ offset: "20"
141
+ },
142
+ {
143
+ limit: 20,
144
+ offset: 20,
145
+ pageSize: 20,
146
+ pageNumber: 2,
147
+ pageIndex: 1
148
+ }
149
+ ],
150
+ [
151
+ "empty input",
152
+ {},
153
+ {
154
+ limit: 20,
155
+ offset: 0,
156
+ pageSize: 20,
157
+ pageNumber: 1,
158
+ pageIndex: 0
159
+ }
160
+ ],
161
+ [
162
+ "negative values",
163
+ {
164
+ pageSize: "-5",
165
+ pageIndex: "-1",
166
+ limit: "-10",
167
+ offset: "-20"
168
+ },
169
+ {
170
+ limit: 1,
171
+ offset: 0,
172
+ pageSize: 1,
173
+ pageNumber: 1,
174
+ pageIndex: 0
175
+ }
176
+ ],
177
+ [
178
+ "custom pageNumber",
179
+ {
180
+ pageNumber: 3,
181
+ pageSize: 15
182
+ },
183
+ {
184
+ limit: 15,
185
+ offset: 30,
186
+ pageSize: 15,
187
+ pageNumber: 3,
188
+ pageIndex: 2
189
+ }
190
+ ]
191
+ ];
192
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
193
+ try {
194
+ for (var _iterator = testCases[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
195
+ var _step_value = _sliced_to_array(_step.value, 3), description = _step_value[0], input = _step_value[1], expected = _step_value[2];
196
+ var result = resolvePagination(input);
197
+ expect(result, description).toMatchObject(expected);
198
+ }
199
+ }
200
+ catch (err) {
201
+ _didIteratorError = true;
202
+ _iteratorError = err;
203
+ }
204
+ finally {
205
+ try {
206
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
207
+ _iterator.return();
208
+ }
209
+ }
210
+ finally {
211
+ if (_didIteratorError) {
212
+ throw _iteratorError;
213
+ }
214
+ }
215
+ }
216
+ });
217
+ test("".concat(resolvePagination.name, " with options"), function () {
218
+ expect(resolvePagination({
219
+ pageSize: "200"
220
+ }, {
221
+ maxLimit: 50
222
+ })).toMatchObject({
223
+ pageSize: 50,
224
+ limit: 50
225
+ });
226
+ expect(resolvePagination({}, {
227
+ pageSize: 30
228
+ })).toMatchObject({
229
+ pageSize: 30,
230
+ limit: 30
231
+ });
232
+ });
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=types.d.js.map
package/lib/index.js CHANGED
@@ -4,4 +4,3 @@
4
4
  /**
5
5
  * @deprecated
6
6
  */ export { resolvePagination as normalizePagination } from "./data/resolvePagination.js";
7
- //# sourceMappingURL=index.js.map