| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ const marked = require('marked'); | |||
| 11 | 11 | // customized heading without id attribute | |
| 12 | 12 | var renderer = new marked.Renderer(); | |
| 13 | 13 | renderer.heading = function(text, level) { | |
| 14 | - return '<h' + level + '>' + text + '</h' + level + '>\n'; | ||
| 14 | + return `<h${level}>${text}</h${level}>\n`; | ||
| 15 | 15 | }; | |
| 16 | 16 | marked.setOptions({ | |
| 17 | 17 | renderer: renderer | |
@@ -225,25 +225,25 @@ function processList(section) { | |||
| 225 | 225 | } else if (type === 'list_item_end') { | |
| 226 | 226 | if (!current) { | |
| 227 | 227 | throw new Error('invalid list - end without current item\n' + | |
| 228 | - JSON.stringify(tok) + '\n' + | ||
| 228 | + `${JSON.stringify(tok)}\n` + | ||
| 229 | 229 | JSON.stringify(list)); | |
| 230 | 230 | } | |
| 231 | 231 | current = stack.pop(); | |
| 232 | 232 | } else if (type === 'text') { | |
| 233 | 233 | if (!current) { | |
| 234 | 234 | throw new Error('invalid list - text without current item\n' + | |
| 235 | - JSON.stringify(tok) + '\n' + | ||
| 235 | + `${JSON.stringify(tok)}\n` + | ||
| 236 | 236 | JSON.stringify(list)); | |
| 237 | 237 | } | |
| 238 | 238 | current.textRaw = current.textRaw || ''; | |
| 239 | - current.textRaw += tok.text + ' '; | ||
| 239 | + current.textRaw += `${tok.text} `; | ||
| 240 | 240 | } | |
| 241 | 241 | }); | |
| 242 | 242 | ||
| 243 | 243 | // shove the name in there for properties, since they are always | |
| 244 | 244 | // just going to be the value etc. | |
| 245 | 245 | if (section.type === 'property' && values[0]) { | |
| 246 | - values[0].textRaw = '`' + section.name + '` ' + values[0].textRaw; | ||
| 246 | + values[0].textRaw = `\`${section.name}\` ${values[0].textRaw}`; | ||
| 247 | 247 | } | |
| 248 | 248 | ||
| 249 | 249 | // now pull the actual values out of the text bits. | |
@@ -345,8 +345,8 @@ function parseSignature(text, sig) { | |||
| 345 | 345 | // at this point, the name should match. | |
| 346 | 346 | if (p !== param.name) { | |
| 347 | 347 | console.error('Warning: invalid param "%s"', p); | |
| 348 | - console.error(' > ' + JSON.stringify(param)); | ||
| 349 | - console.error(' > ' + text); | ||
| 348 | + console.error(` > ${JSON.stringify(param)}`); | ||
| 349 | + console.error(` > ${text}`); | ||
| 350 | 350 | } | |
| 351 | 351 | if (optional) param.optional = true; | |
| 352 | 352 | if (def !== undefined) param.default = def; | |
@@ -411,7 +411,7 @@ function parseListItem(item) { | |||
| 411 | 411 | function finishSection(section, parent) { | |
| 412 | 412 | if (!section || !parent) { | |
| 413 | 413 | throw new Error('Invalid finishSection call\n' + | |
| 414 | - JSON.stringify(section) + '\n' + | ||
| 414 | + `${JSON.stringify(section)}\n` + | ||
| 415 | 415 | JSON.stringify(parent)); | |
| 416 | 416 | } | |
| 417 | 417 | ||
@@ -471,11 +471,11 @@ function finishSection(section, parent) { | |||
| 471 | 471 | ||
| 472 | 472 | var plur; | |
| 473 | 473 | if (section.type.slice(-1) === 's') { | |
| 474 | - plur = section.type + 'es'; | ||
| 474 | + plur = `${section.type}es`; | ||
| 475 | 475 | } else if (section.type.slice(-1) === 'y') { | |
| 476 | 476 | plur = section.type.replace(/y$/, 'ies'); | |
| 477 | 477 | } else { | |
| 478 | - plur = section.type + 's'; | ||
| 478 | + plur = `${section.type}s`; | ||
| 479 | 479 | } | |
| 480 | 480 | ||
| 481 | 481 | // if the parent's type is 'misc', then it's just a random | |
| Back | FazBrowse Home | New Git URL |
0 commit comments