Skip to content

Commit

Permalink
require string, remove nodes params (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdroidian authored May 19, 2024
1 parent f8acd94 commit 40608d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/query-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ For developers of other extensions who want to use the queries defined by users,
- `uid` - `string` The reference of the primary node involved in the result.
- `${string}-uid` - `string` If the users define selections that return intermediary nodes, the reference of those nodes will always end in `-uid` and will always be of type `string`.
- `{string}` - `string | number | Date` All other fields returned in the result can be any of the primitive value types.
- `isDiscourseNode` - `(uid?: string, nodes?: DiscourseNode[]) => boolean` Returns whether the input `uid` is a discourse node.
- `isDiscourseNode` - `(uid: string) => boolean` Returns whether the input `uid` is a discourse node.

## Examples

Expand Down
3 changes: 2 additions & 1 deletion src/utils/isDiscourseNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import getDiscourseNodes from "./getDiscourseNodes";
import findDiscourseNode from "./findDiscourseNode";

const isDiscourseNode = (uid?: string, nodes = getDiscourseNodes()) => {
const isDiscourseNode = (uid: string) => {
const nodes = getDiscourseNodes();
const node = findDiscourseNode(uid, nodes);
if (!node) return false;
return node.backedBy !== "default";
Expand Down

0 comments on commit 40608d0

Please sign in to comment.