@aimeloic/monkey-tester 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/htmlTemplate.js +3 -3
  2. package/package.json +1 -1
package/htmlTemplate.js CHANGED
@@ -151,7 +151,7 @@ function buildSidebar() {
151
151
 
152
152
  function makeInputString(type, id, placeholder, defaultValue) {
153
153
  const pAttr = placeholder ? ' placeholder="' + placeholder + '"' : '';
154
- const vAttr = defaultValue !== undefined ? ' value=\'' + defaultValue + '\'' : '';
154
+ const vAttr = defaultValue !== undefined ? ' value="' + defaultValue + '"' : '';
155
155
  return '<input type="' + type + '" id="' + id + '"' + pAttr + vAttr + ' />';
156
156
  }
157
157
 
@@ -161,7 +161,7 @@ function renderPanel(epKey) {
161
161
  const main = document.getElementById('main-panel');
162
162
  if (!ep) return;
163
163
 
164
- // Render core elements utilizing un-escaped container tokens safely
164
+ // FIXED: Escaped template strings (\`) prevent string concatenation mismatch errors
165
165
  let html = \`
166
166
  <div class="endpoint-title">\${ep.title}</div>
167
167
  <div class="endpoint-path">
@@ -230,7 +230,7 @@ async function sendRequest() {
230
230
 
231
231
  let body = undefined;
232
232
  if (ep.fields && ep.fields.length && ['POST', 'PUT', 'PATCH'].includes(ep.method)) {
233
- const rawVal = document.getElementById('field-' + ep.fields[0].name).value.trim();
233
+ const rawVal = document.getElementById('field-' + ep.fields[0].name)?.value?.trim() ?? '';
234
234
  try {
235
235
  JSON.parse(rawVal);
236
236
  body = rawVal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aimeloic/monkey-tester",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Auto route scanning visual runner dashboard.",
5
5
  "main": "index.js",
6
6
  "type": "module",