Skip to content

Commit

Permalink
Merge pull request #77 from ty-ras/issue/76-fix-data-frontend-output-…
Browse files Browse the repository at this point in the history
…ts-files

#76 Fixing the data-frontend package not to have …
  • Loading branch information
stazz authored Sep 16, 2023
2 parents 6e157f4 + 48db785 commit f0a8ead
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/data-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ty-ras/data-frontend",
"version": "2.1.1",
"version": "2.1.2",
"author": {
"name": "Stanislav Muhametsin",
"email": "[email protected]",
Expand Down
11 changes: 11 additions & 0 deletions code/data-frontend/src/clients.fix.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @file This file contains code to make output .d.ts files NOT to have the line: /// <reference types="node" />
*/

declare global {
interface URLSearchParams {}
}

// Without this we will get error:
// Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
export {};
4 changes: 3 additions & 1 deletion code/data-frontend/src/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const ensurePathname = (pathname: string) => {
* @param query The query parameters as named objects.
* @returns The {@link URLSearchParams} with arrayed query parameters unwrapped.
*/
export const getURLSearchParams = (query: Record<string, unknown>) =>
export const getURLSearchParams = (
query: Record<string, unknown>,
): URLSearchParams =>
new URLSearchParams(
Object.entries(query)
.filter(([, value]) => value !== undefined)
Expand Down

0 comments on commit f0a8ead

Please sign in to comment.