Skip to content
Myr

Added specs for escape() and toArray()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 4f8c45c · Browse files · 3 files+52 added−31 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+52 added−31 removed

  • tests:+21 added−0 removed
  • other:+31 added−31 removed

3 files+52 added−31 removed

modified:lib/express/core.js-31 removed
122 unmodified lines
123 return path.replace(/[\s\/]*$/g, '')124}125126/**127 * Escape special characters in _html_.128 *129 * @param {string} html130 * @return {string}131 * @api public132 */133134escape = function(html) {135 if (html instanceof String)136 return html137 .replace(/&/g, '&amp;')138 .replace(/"/g, '&quot;')139 .replace(/</g, '&lt;')140 .replace(/>/g, '&gt;')141}142143/**144 * Convert native array-like objects into an145 * array with optional _offset_.146 *147 * @param {object} arr148 * @param {int} offset149 * @return {array}150 * @api public151 */152153toArray = function(arr, offset) {154 return Array.prototype.slice.call(arr, offset)155}156157/**127 * Return a routing function for _method_.128 *129 * @param {string} method130 * @return {function}
90 unmodified lines
modified:lib/express/helpers.js+31 added
modified:spec/spec.core.helpers.js+21 added