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

New type guard checks have the wrong input type #126

Closed
drewhoener opened this issue Jul 25, 2023 · 2 comments · Fixed by #127
Closed

New type guard checks have the wrong input type #126

drewhoener opened this issue Jul 25, 2023 · 2 comments · Fixed by #127

Comments

@drewhoener
Copy link

the type guard check isArrayOfNodes is listed as taking SelectedValue which is a problem since that type no longer includes an array of Nodes.

Expected definition:

export function isArrayOfNodes(value: SelectReturnType): value is Node[];
@danielweck
Copy link

Ah yes, same problem :(

node_modules/xpath/xpath.d.ts:42:64 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'Node[]' is not assignable to type 'SelectedValue'.

42 export function isArrayOfNodes(value: SelectedValue): value is Node[];
                                                                  ~~~~~~


Found 1 error in node_modules/xpath/xpath.d.ts:42

@cjbarth
Copy link

cjbarth commented Sep 19, 2023

This code has migrated to a new dependency that is more compatible and can iterate faster. Have a look at https://github.com/xmldom/is-dom-node.

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 a pull request may close this issue.

3 participants