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: release as "next" #226

Merged
merged 9 commits into from
Jan 2, 2024
Merged

Major Change Interface: release as "next" #226

merged 9 commits into from
Jan 2, 2024

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 merged commit 86d55dc into main Jan 2, 2024
8 checks passed
@omrilotan omrilotan deleted the next branch January 2, 2024 16:56
omrilotan added a commit that referenced this pull request Jan 2, 2024
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