Skip to content

[Replacement]: is-extglob #1012

Description

@outslept

Package to replace

is-extglob

Suggested replacement(s)

const isExtglob = (str) => {
  if (typeof str !== 'string' || !str) return false

  let match
  while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
    if (match[2]) return true
    str = str.slice(match.index + match[0].length)
  }

  return false
}

For string-only : const isExtglob = (str) => /[@?!+*](/.test(str)

Manifest type

micro-utility (tiny utility replaceable with native code or removal)

Rationale

inlinable

Availability

No response

Code example (optional)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions