Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect default documented for mergeArrays option #395

Closed
colinrotherham opened this issue Aug 8, 2024 · 2 comments · Fixed by #396
Closed

Incorrect default documented for mergeArrays option #395

colinrotherham opened this issue Aug 8, 2024 · 2 comments · Fixed by #396
Labels
types TypeScript type definitions
Milestone

Comments

@colinrotherham
Copy link
Contributor

Module version

11.0.4

What documentation problem did you notice?

The type declarations for merge() have mergeArrays: false incorrectly set by default:

hoek/lib/index.d.ts

Lines 116 to 121 in 7309947

/**
* When true, array value from `source` is merged with the existing value in `target`.
*
* @default false
*/
readonly mergeArrays?: boolean;

But the source code (and documentation) shows mergeArrays: true as the default:

options = Object.assign({ nullOverride: true, mergeArrays: true }, options);

This caught me out recently, I'll open a PR if that's alright

@colinrotherham colinrotherham added the documentation Non-code related changes label Aug 8, 2024
colinrotherham added a commit to DEFRA/forms-runner that referenced this issue Aug 8, 2024
The types had the incorrect default so I flipped this the wrong way previously. See: hapijs/hoek#395
@kanongil kanongil added types TypeScript type definitions and removed documentation Non-code related changes labels Aug 8, 2024
@kanongil
Copy link
Contributor

kanongil commented Aug 8, 2024

Thanks for the report! A PR would be welcome.

@colinrotherham
Copy link
Contributor Author

No problem @kanongil, fixed in #396

@Marsup Marsup linked a pull request Aug 8, 2024 that will close this issue
@Marsup Marsup added this to the 11.0.5 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types TypeScript type definitions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants