VideoQuest / src /lib /parseJsonList.ts
jbilcke-hf's picture
jbilcke-hf HF staff
up
f0dc1c3
raw
history blame
363 Bytes
export function parseJsonList(content: string): string[] {
// Extract JSON array from the content
const start = content.indexOf("[");
const end = content.lastIndexOf("]");
const jsonContent = content.slice(start, end + 1);
// Parse as JSON into array of strings
let objects: string[] = [];
objects = JSON.parse(jsonContent);
return objects;
}