{"version":3,"sources":["../../../src/lib/codeBlock.ts"],"names":[],"mappings":";;;;;;AAAA,IAAM,GAAA,GAAM,MAAO,CAAA,YAAA,CAAa,IAAI,CAAA;AA4B7B,SAAS,aAAa,IAAiC,EAAA;AAC7D,EAAA,MAAM,CAAC,QAAA,EAAU,OAAO,CAAA,GAAI,IAAK,CAAA,MAAA,KAAW,CAAI,GAAA,CAAC,EAAI,EAAA,IAAA,CAAK,CAAC,CAAC,CAAI,GAAA,IAAA;AAChE,EAAA,OAAO,SAAS,QAAQ;AAAA,EAAK,MAAO,CAAA,OAAO,CAAE,CAAA,OAAA,CAAQ,OAAO,CAAK,EAAA,EAAA,GAAG,CAAM,IAAA,CAAA,CAAA,CAAE,OAAQ,CAAA,KAAA,EAAO,CAAK,EAAA,EAAA,GAAG,EAAE,CAAC;AAAA,MAAA,CAAA;AACvG;AAHgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"codeBlock.cjs","sourcesContent":["const zws = String.fromCharCode(8203);\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @remark If the provided content includes 3 backticks (```) then those backticks will be escaped\n * by adding a [Zero Width Space](https://en.wikipedia.org/wiki/Zero-width_space) between the first and second backtick\n *\n * @remark If the provided content ends with a backtick then a [Zero Width Space](https://en.wikipedia.org/wiki/Zero-width_space) will be added\n * to the end of the content\n *\n * @param content - The content to wrap\n */\nexport function codeBlock<C extends string>(content: C): `\\`\\`\\`\\n${C}\\n\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @remark If the provided content includes 3 backticks (```) then those backticks will be escaped\n * by adding a [Zero Width Space](https://en.wikipedia.org/wiki/Zero-width_space) between the first and second backtick\n *\n * @remark If the provided content ends with a backtick then a [Zero Width Space](https://en.wikipedia.org/wiki/Zero-width_space) will be added\n * to the end of the content\n *\n * @param language The codeblock language\n * @param content The expression to be wrapped in the codeblock\n */\nexport function codeBlock<L extends string, C extends string>(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\n\\`\\`\\``;\nexport function codeBlock(...args: [string, string?]): string {\n\tconst [language, content] = args.length === 1 ? ['', args[0]] : args;\n\treturn `\\`\\`\\`${language}\\n${String(content).replace(/```/, `\\`${zws}\\`\\``).replace(/`$/g, `\\`${zws}`)}\\n\\`\\`\\``;\n}\n"]}