(str)
| 453 | } |
| 454 | } |
| 455 | function escapeText(str) { |
| 456 | if (!str) { |
| 457 | return ''; |
| 458 | } |
| 459 | |
| 460 | // Both single quotes and double quotes (for attributes) |
| 461 | return ('' + str).replace(/['"<>&]/g, function (s) { |
| 462 | switch (s) { |
| 463 | case "'": |
| 464 | return '''; |
| 465 | case '"': |
| 466 | return '"'; |
| 467 | case '<': |
| 468 | return '<'; |
| 469 | case '>': |
| 470 | return '>'; |
| 471 | case '&': |
| 472 | return '&'; |
| 473 | } |
| 474 | }); |
| 475 | } |
| 476 | |
| 477 | var BOXABLE_TYPES = new StringSet(['boolean', 'number', 'string']); |
| 478 |
no outgoing calls
no test coverage detected