import { surround } from "https://deno.land/x/froebel@v0.18.0/surround.ts";
Surrounds the str
with surrounding
. surrounding
must have an even length.
Examples
Example 1
Example 1
surround("foo", "()") // "(foo)"
surround("foo", "({[]})") // "({[foo]})"
type
<A extends string, B extends string>(str: A, surrounding: B) => B extends "" ? A : IsEvenLength<B> extends true ? Surround<A, B> : never