UNPKG

extract-codefence

Version:

A utility to extract code from codefence blocks

9 lines (8 loc) 183 B
// index.ts var extractCodefence = (text) => { const codefence = text.match(/```(tsx?|typescript)?([\s\S]*?)```/); return codefence?.[2].trim(); }; export { extractCodefence };