UNPKG

cucumber-ai

Version:

Write automated tests using natural language

11 lines 343 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseJson = parseJson; function parseJson(text) { const jsonMatch = text.match(/\{[\s\S]*}/); if (!jsonMatch) { throw new Error(`No JSON string found in: ${text}`); } return JSON.parse(jsonMatch[0]); } //# sourceMappingURL=json.js.map