@n3okill/utils
Version:
Many javascript helpers
26 lines • 566 B
JavaScript
import { toString } from "./toString";
import { isBalanced as isBalancedString } from "../string/isBalanced";
/**
* Check for a balanced use of 'open' and 'close' strings
*
* Examples:
*
* input: "{hello} world"
* open: "{"
* close: "}"
* result: true
*
*
* input: "hello} world"
* open: "{"
* close: "}"
* result: false
* @param input
* @param open
* @param close
* @returns
*/
export function isBalanced(input, open = "{", close = "}") {
return isBalancedString(toString(input), open, close);
}
//# sourceMappingURL=isBalanced.js.map