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

Major Change Interface #225

Closed
wants to merge 1 commit into from
Closed

Major Change Interface #225

wants to merge 1 commit into from

Conversation

omrilotan
Copy link
Owner

This change is meant to reduce the size of the package and improve performance by building the regular expression in build time instead of runtime.

  • Change interface

    • Remove default import. Use named import instead: import { isbot } from "isbot";
    • Drop isbot attached functions from the interface. isbot.<SOMETHING> is no longer supported
  • Drop support for EOL node versions

New features

import { <SOMETHING> }  from "isbot";
import Type Description
pattern {RegExp} The regular expression used to identify bots
list {string[]} List of all individual pattern parts
isbotMatch {(userAgent: string): string | null} The substring matched by the regular expression
isbotMatches {(userAgent: string): string[]} All substrings matched by the regular expression
isbotPattern {(userAgent: string): string | null} The regular expression used to identify bot substring in the user agent
isbotPatterns {(userAgent: string): string[]} All regular expressions used to identify bot substrings in the user agent
createIsbot {(pattern: RegExp): (userAgent: string): boolean} Create a custom isbot function

@omrilotan omrilotan force-pushed the major-version branch 10 times, most recently from 04b2722 to 1ca96c0 Compare December 18, 2023 12:21
@omrilotan omrilotan marked this pull request as ready for review December 18, 2023 12:26
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 this pull request may close these issues.

1 participant