Skip to content

API: how to query node whether it's a directory (in a consistent way)? #2443

Answered by Akmadan23
przepompownia asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure what you're looking for, nodes are just tables, so to check whether a node is a directory you have two options:

  • check if node.type is 'directory' (like you did)
  • check if node.nodes is a table

Then there is the root node, which actually is not a node, since it's a table with only the name field.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@przepompownia
Comment options

@Akmadan23
Comment options

Answer selected by Akmadan23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants