Update api reference docs from review comments. Uses latest brodocs release.
This commit is contained in:
+33
-11
@@ -45,17 +45,17 @@ exports.escapeRegExpChars = function (string) {
|
||||
};
|
||||
|
||||
var _ENCODE_HTML_RULES = {
|
||||
'&': '&'
|
||||
, '<': '<'
|
||||
, '>': '>'
|
||||
, '"': '"'
|
||||
, "'": '''
|
||||
}
|
||||
, _MATCH_HTML = /[&<>\'"]/g;
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
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 = {};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user