fastapi-rtk 0.1.33 → 0.1.34

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.
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const initialQueryParams = {
3
+ const getInitialQueryParams = () => ({
4
4
  columns: [],
5
5
  filters: [],
6
6
  page: 0,
7
7
  page_size: 25
8
- };
9
- function createQueryParams(currentQueryParams, partialQueryParams = {}) {
10
- return Object.entries(partialQueryParams).reduce(
11
- (acc, [key, value]) => {
12
- if (value === null || value === void 0) {
13
- delete acc[key];
14
- return acc;
15
- }
16
- return { ...acc, [key]: value };
17
- },
18
- { ...currentQueryParams ?? initialQueryParams }
19
- );
20
- }
8
+ });
9
+ const createQueryParams = (currentQueryParams, partialQueryParams = {}) => Object.entries(partialQueryParams).reduce(
10
+ (acc, [key, value]) => {
11
+ if (value === null || value === void 0) {
12
+ delete acc[key];
13
+ return acc;
14
+ }
15
+ return { ...acc, [key]: value };
16
+ },
17
+ { ...currentQueryParams ?? getInitialQueryParams() }
18
+ );
21
19
  exports.createQueryParams = createQueryParams;
@@ -1,21 +1,19 @@
1
- const initialQueryParams = {
1
+ const getInitialQueryParams = () => ({
2
2
  columns: [],
3
3
  filters: [],
4
4
  page: 0,
5
5
  page_size: 25
6
- };
7
- function createQueryParams(currentQueryParams, partialQueryParams = {}) {
8
- return Object.entries(partialQueryParams).reduce(
9
- (acc, [key, value]) => {
10
- if (value === null || value === void 0) {
11
- delete acc[key];
12
- return acc;
13
- }
14
- return { ...acc, [key]: value };
15
- },
16
- { ...currentQueryParams ?? initialQueryParams }
17
- );
18
- }
6
+ });
7
+ const createQueryParams = (currentQueryParams, partialQueryParams = {}) => Object.entries(partialQueryParams).reduce(
8
+ (acc, [key, value]) => {
9
+ if (value === null || value === void 0) {
10
+ delete acc[key];
11
+ return acc;
12
+ }
13
+ return { ...acc, [key]: value };
14
+ },
15
+ { ...currentQueryParams ?? getInitialQueryParams() }
16
+ );
19
17
  export {
20
18
  createQueryParams
21
19
  };
@@ -1,12 +1,3 @@
1
- /**
2
- * Creates a new query parameters object by merging the current query parameters
3
- * with the partial query parameters. If a value in the partial query parameters
4
- * is null or undefined, the corresponding key is removed from the resulting object.
5
- *
6
- * @param {Record<string, any> | null | undefined} currentQueryParams - The current query parameters.
7
- * @param {Record<string, any>} [partialQueryParams] - The partial query parameters to merge. Defaults to `{}`.
8
- * @returns The new query parameters object.
9
- */
10
1
  export function createQueryParams(currentQueryParams: Record<string, any> | null | undefined, partialQueryParams?: Record<string, any>): {
11
2
  [x: string]: any;
12
3
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "private": false,
5
5
  "description": "A React component library for FastAPI in combination with FastAPI React Toolkit backend, built with Mantine, JsonForms, and Zustand.",
6
6
  "license": "MIT",