1.0.1 • Published 7 years ago

strip-brackets v1.0.1

Weekly downloads
11
License
-
Repository
github
Last release
7 years ago

strip-brackets

Strips unecessary brackets

Greenkeeper badge

Usage

Pass it some configuration parameters and it will give you a new function that strips all unnecessary brackets.

Function Signature

stripBrackets(openChar = '[', closeChar = ']', joinChars = [',']) => input => output
import stripBrackets from 'strip-brackets';

const stripSquareBrackets = stripBrackets('[', ']', [',']);
stripSquareBrackets('[[a,b],[c],[[d]]]'); // => "[a,b],c,d"

const stripParens = stripBrackets('(', ')', [',']);
stripParens('((a,b),(c),((d)))'); // => "(a,b),c,d"

Parameters