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

select1() will return undefined when it can't find anything #140

Open
YbJerry opened this issue Jan 30, 2024 · 0 comments
Open

select1() will return undefined when it can't find anything #140

YbJerry opened this issue Jan 30, 2024 · 0 comments

Comments

@YbJerry
Copy link

YbJerry commented Jan 30, 2024

When select1() can't find anything, it will return undefined. But at first, I think it should return null as I don't find undefined in type SelectSingleReturnType

In line 5000 of path.js

result = result.nodes;
if (single) {
    result = result[0];
}

In this situation, nodes will be an empty array. So result[0] will be undefined.

So I suggest that there should be a comment for users to know it will return undefined. 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

No branches or pull requests

1 participant