Update api reference docs from review comments. Uses latest brodocs release.

This commit is contained in:
Phillip Wittrock
2017-01-03 08:51:38 -08:00
parent 39fe9ab8e8
commit cc12b16d99
240 changed files with 14530 additions and 9984 deletions
+33 -11
View File
@@ -45,17 +45,17 @@ exports.escapeRegExpChars = function (string) {
};
var _ENCODE_HTML_RULES = {
'&': '&'
, '<': '&lt;'
, '>': '&gt;'
, '"': '&#34;'
, "'": '&#39;'
}
, _MATCH_HTML = /[&<>\'"]/g;
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&#34;',
"'": '&#39;'
};
var _MATCH_HTML = /[&<>\'"]/g;
function encode_char(c) {
return _ENCODE_HTML_RULES[c] || c;
};
}
/**
* Stringified version of constants used by {@link module:utils.escapeXML}.
@@ -98,11 +98,13 @@ exports.escapeXML = function (markup) {
.replace(_MATCH_HTML, encode_char);
};
exports.escapeXML.toString = function () {
return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr
return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr;
};
/**
* Copy all properties from one object to another, in a shallow fashion.
* Naive copy of properties from one object to another.
* Does not recurse into non-scalar properties
* Does not check to see if the property has a value before copying
*
* @param {Object} to Destination object
* @param {Object} from Source object
@@ -118,6 +120,27 @@ exports.shallowCopy = function (to, from) {
return to;
};
/**
* Naive copy of a list of key names, from one object to another.
* Only copies property if it is actually defined
* Does not recurse into non-scalar properties
*
* @param {Object} to Destination object
* @param {Object} from Source object
* @param {Array} list List of properties to copy
* @return {Object} Destination object
* @static
* @private
*/
exports.shallowCopyFromList = function (to, from, list) {
list.forEach(function (p) {
if (typeof from[p] != 'undefined') {
to[p] = from[p];
}
});
return to;
};
/**
* Simple in-process cache implementation. Does not implement limits of any
* sort.
@@ -138,4 +161,3 @@ exports.cache = {
this._data = {};
}
};