(str, targetApp = 'loon-plugin')
| 2134 | } |
| 2135 | |
| 2136 | function unwrapJsonArgument(str, targetApp = 'loon-plugin') { |
| 2137 | let value = normalizeTemplateValue(str, targetApp) |
| 2138 | value = stripWrapQuote(value).trim() |
| 2139 | const unescaped = value.replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\\\/g, '\\').trim() |
| 2140 | if (/^\s*\{[\s\S]*\}\s*$/.test(unescaped) && /:/.test(unescaped)) return unescaped |
| 2141 | if (/^\s*\{[\s\S]*\}\s*$/.test(value) && /:/.test(value)) return value |
| 2142 | return /^\s*\{[\s\S]*\}\s*$/.test(unescaped) && /:/.test(unescaped) ? unescaped : '' |
| 2143 | } |
| 2144 | |
| 2145 | function isJsonObjectArgument(str) { |
| 2146 | return !!unwrapJsonArgument(str) |
no test coverage detected