Skip to content

Comments

fix(types): export function definition types#65

Merged
Uzlopak merged 2 commits intofastify:masterfrom
simonepizzamiglio:chore/export-fn-types
Jan 27, 2025
Merged

fix(types): export function definition types#65
Uzlopak merged 2 commits intofastify:masterfrom
simonepizzamiglio:chore/export-fn-types

Conversation

@simonepizzamiglio
Copy link
Contributor

@simonepizzamiglio simonepizzamiglio commented Jan 22, 2025

Fixes #12.

While working on one of my private projects, I encountered the same issue described in #12.
I’m using deepmerge with TypeScript, and when building my project, I experienced the heap out of memory error mentioned in that issue.

To resolve this, I tried exporting DeepMergeFn and DeepMergeAllFn directly from the @fastify/deepmerge folder in node_modules, which successfully fixed the problem.

Alternatively, if the issue persists, you can leverage these types as follows:

const deepmergeAll: DeepMergeAllFn = deepmerge({ all: true });

Checklist

@simonepizzamiglio simonepizzamiglio marked this pull request as ready for review January 22, 2025 23:02
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR! Can you please add a unit test? We use tsd for types.

@simonepizzamiglio
Copy link
Contributor Author

Thanks for opening a PR! Can you please add a unit test? We use tsd for types.

@mcollina Tests added 🙂

@Fdawgs Fdawgs requested a review from a team January 27, 2025 08:40
Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess exporting the types wont harm ;)

@Fdawgs Fdawgs changed the title chore(types): export function definition types fix(types): export function definition types Jan 27, 2025
@Uzlopak Uzlopak merged commit e23814e into fastify:master Jan 27, 2025
16 checks passed
@Fdawgs Fdawgs mentioned this pull request Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.

4 participants