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

Function takeLeadingTemplate

Rewrite-Parser.beta.js:2271–2274  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2269}
2270
2271function takeLeadingTemplate(str) {
2272 const matched = `${str ?? ''}`.match(/^(\s*)\{\{\{([^{}]+)\}\}\}\s*(.*)$/)
2273 return matched ? { key: matched[2].trim(), rest: matched[1] + matched[3] } : null
2274}
2275
2276function getHnValue(item) {
2277 return typeof item == 'object' && item !== null ? item.value : item

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected