Skip to content

Conversation

@r3gor
Copy link

@r3gor r3gor commented Sep 13, 2025

  • Add includeDetails parameter to main export function
  • Return position metadata when requested
  • Add tests and documentation

- Add includeDetails parameter to main export function
- Return position metadata when requested
- Add tests and documentation

Add position information support

- Add includeDetails parameter to main export function
- Return position metadata when requested
- Add tests and documentation
};

module.exports = (str) => {
module.exports = (str, includeDetails = false) => {
Copy link
Owner

Choose a reason for hiding this comment

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

I can't imagine anyone is using a node version old enough for this to matter, but we should nonetheless update the engines key in package.json for node 6.0.0, since that is when default parameters became standard.

Copy link
Owner

Choose a reason for hiding this comment

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

I guess it should have actually already been that, since I was using const and let, so you can help me out by fixing my mistake

}

if (!includeDetails) {
return objects.map(item => item.object);
Copy link
Owner

Choose a reason for hiding this comment

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

I like to always put parens around function parameters, even when not required as in this case.

Suggested change
return objects.map(item => item.object);
return objects.map((item) => item.object);

Copy link
Owner

@tandrewnichols tandrewnichols left a comment

Choose a reason for hiding this comment

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

A couple small things I'd like to have done, but then happy to merge and publish this. Thanks!

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.

2 participants