MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / normalizeTemplateValue

Function normalizeTemplateValue

Rewrite-Parser.beta.js:2284–2294  ·  view source on GitHub ↗
(value, targetApp)

Source from the content-addressed store, hash-verified

2282}
2283
2284function normalizeTemplateValue(value, targetApp) {
2285 if (!value) return value
2286 value = stripWrapQuote(value)
2287 if (targetApp == 'surge-module' || targetApp == 'shadowrocket-module') {
2288 return value.replace(/(?<!\{)\{([^{}]+)\}(?!\})/g, '{{{$1}}}')
2289 }
2290 if (targetApp == 'loon-plugin') {
2291 return value.replace(/\{\{\{([^{}]+)\}\}\}/g, '{$1}')
2292 }
2293 return value
2294}
2295
2296function formatCronexp(value, targetApp) {
2297 if (!value) return value

Callers 4

unwrapJsonArgumentFunction · 0.85
normalizeScriptArgumentFunction · 0.85
formatCronexpFunction · 0.85

Calls 1

stripWrapQuoteFunction · 0.85

Tested by

no test coverage detected