Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/dynablox_opencloud/src/rest/utils/balanced.ts

A Roblox OpenCloud API wrapper for Deno and NodeJS written in TypeScript.
Latest
import * as dynabloxOpencloud from "https://deno.land/x/dynablox_opencloud@v0.2.2/src/rest/utils/balanced.ts";

Functions

For the first non-nested matching pair of a and b in str, return an object with those keys: start the index of the first match of end the index of the matching b pre the preamble, a and b not included body the match, a and b not included post the postscript, a and b not included If there's no match, undefined will be returned. If the str contains more a than b / there are unmatched pairs, the first match that was closed will be used. For example, {{a} will match ['{', 'a', ''] and {a}} will match ['', 'a', '}']

For the first non-nested matching pair of a and b in str, return an array with indexes: [ <a index>, <b index> ].