Socket
Socket
Sign inDemoInstall

expand-brackets

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expand-brackets

Expand POSIX bracket expressions (character classes) in glob patterns.


Version published
Weekly downloads
10M
decreased by-19.26%
Maintainers
3
Weekly downloads
 
Created

What is expand-brackets?

The expand-brackets npm package is used to expand and parse bracket expressions in strings. It is particularly useful for handling patterns in strings that involve brackets, such as character classes in regular expressions.

What are expand-brackets's main functionalities?

Expand Bracket Expressions

This feature allows you to expand bracket expressions into their constituent characters. For example, the expression '[a-c]' is expanded into ['a', 'b', 'c'].

const expandBrackets = require('expand-brackets');
console.log(expandBrackets('[a-c]')); // Output: ['a', 'b', 'c']

Handle Negated Bracket Expressions

This feature handles negated bracket expressions, expanding them while preserving the negation symbol. For example, '[^a-c]' is expanded into ['^', 'a', 'b', 'c'].

const expandBrackets = require('expand-brackets');
console.log(expandBrackets('[^a-c]')); // Output: ['^', 'a', 'b', 'c']

Custom Bracket Expansion

This feature allows for custom expansion of bracket expressions based on options provided. For example, using the option { expand: true } with '[a-c]' results in ['a', 'b', 'c'].

const expandBrackets = require('expand-brackets');
console.log(expandBrackets('[a-c]', { expand: true })); // Output: ['a', 'b', 'c']

Other packages similar to expand-brackets

Keywords

FAQs

Package last updated on 20 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc