UNPKG

@n3okill/utils

Version:
16 lines 612 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.balanced = balanced; const toString_1 = require("../string/toString"); const balanced_1 = require("../string/balanced"); /** * Return `false` if buffer is unbalanced, or * an Array<BalancedDataBuffer> mapping the chunks of 'open' and 'close' locations, if input buffer is unbalanced will return empty * @param input * @param open * @param close */ function balanced(input, open = "{", close = "}") { return (0, balanced_1.balanced)((0, toString_1.toString)(input), open, close); } //# sourceMappingURL=balanced.js.map