MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / getJSONBlock

Function getJSONBlock

out/cli.cjs:85122–85130  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

85120var removeDoubleNewlines = (input) => {
85121 const pattern = /\\n\\n/g;
85122 if (pattern.test(input)) {
85123 const newInput = input.replace(pattern, "");
85124 return removeDoubleNewlines(newInput);
85125 }
85126 return input;
85127};
85128var getJSONBlock = (input) => {
85129 const jsonIndex = input.search("```json");
85130 if (jsonIndex > -1) {
85131 input = input.slice(jsonIndex + 8);
85132 const endJsonIndex = input.search("```");
85133 input = input.slice(0, endJsonIndex);

Callers 1

Calls 2

searchMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…