From 4bee8c9ead68ec531a0faf95e8727849756032ea Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 14 Jun 2016 23:13:32 -0700 Subject: [PATCH] Add docs for split out functions. [ci skip] --- lodash.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 96b0c9dc8..5d078c7f3 100644 --- a/lodash.js +++ b/lodash.js @@ -6146,7 +6146,7 @@ /** * Sets the `toString` method of `wrapper` to mimic the source of `ref` - * with wrapper details added to a comment at the top of the source body. + * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. @@ -6163,11 +6163,26 @@ }); }; + /** + * Extracts the wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } + /** + * Inserts the wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ function insertWrapDetails(source, details) { var length = details.length, lastIndex = length - 1; @@ -6177,6 +6192,14 @@ return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } + /** + * Updates the wrapper `details` base on the `bitmask` flags. + * + * @private + * @returns {Array} details The details to insert. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0];