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

export detectors and standalone detect/collect functions #143

Closed
Le0Developer opened this issue Aug 26, 2023 · 1 comment
Closed

export detectors and standalone detect/collect functions #143

Le0Developer opened this issue Aug 26, 2023 · 1 comment

Comments

@Le0Developer
Copy link
Contributor

We're trying to implement botd by using collect() client-side, sending the components to the server and then running detect() there.
The current BotDetector class interface does not allow that kind of use.

My suggestion: move detect and collect into standalone functions that are exported.
The BotDetector class could use those functions itself too, to prevent code duplication. (this would also allow tree-shaking to remove the BotDetector class or detectors - assuming they are marked as pure)

The client-side is possible to implement manually (by copying the function out of the class and adapting it), because luckily the sources list is exported.
The server-side validation is impossible because detectors is not currently being exported.

@xnerhu
Copy link
Contributor

xnerhu commented Nov 5, 2023

Released in v1.7.0

@xnerhu xnerhu closed this as completed Nov 5, 2023
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

2 participants