Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/dxx/src/lib/xArgs.ts>braceExpand

🚀 (Deno) enhanced executor
Latest
function braceExpand
import { braceExpand } from "https://deno.land/x/dxx@rf/src/lib/xArgs.ts";

Brace expand a string argument.

  • Bash-like brace expansion (compatible with the Bash v4.3 specification).
  • Quotes (single or double) are used to protect braces from expansion; unbalanced quotes are allowed (and parsed as if completed by the end of the string). No character escape sequences are recognized.
  • Supports lists/sets, ranges/sequences, and range increments.

Uses the 'braces' JS module.

Examples

Example 1

const text = '{a,b} text string {1..10..2}';
const expansion = expand(text);

Parameters

s: string