josdejong/jsonrepair

Exporting parse function

开放

#154 创建于 2026年2月22日

 (4 条评论) (0 个反应) (0 位负责人)TypeScript (88 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (2,397 个星标)
PR 合并指标
 (平均合并 26天 22小时) (30 天内合并 2 个 PR)

描述

👋 @josdejong! Great useful package!

I found myself doing this in a few places:

const repairedJson = jsonrepair(rawJson);
const parsedJson = JSON.parse(repairedJson);

This works well, but could be more efficient:

const parsedJson = repairAndParseJson(rawJson);

If this is available to end users, jsonrepair won't have to serialize a repaired structure back to a string. As a result, less memory and CPU will be used. WDYT of exposing some kind of a repair and parse function for the library?

贡献者指南