UNPKG

genpower

Version:

Unified TypeScript library to generate, validate, and structure AI model outputs

8 lines (7 loc) 251 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractJSON = extractJSON; function extractJSON(text) { const match = text.match(/```json\s*([\s\S]*?)```/i); return match ? match[1].trim() : text.trim(); }