* function, if none, pass empty string.
* @param {string} newVal New value that may have to be trimmed down.
* @param {number} byteLimit Number of bytes the value may be in size.
- * @param {Function} [filterFn] Function to call on the string before assessing the length.
+ * @param {Function} [filterFunction] Function to call on the string before assessing the length.
* @return {Object}
* @return {string} return.newVal
* @return {boolean} return.trimmed
*/
- function trimByteLength( safeVal, newVal, byteLimit, filterFn ) {
+ function trimByteLength( safeVal, newVal, byteLimit, filterFunction ) {
var lengthFn;
- if ( filterFn ) {
+ if ( filterFunction ) {
lengthFn = function ( val ) {
- return byteLength( filterFn( val ) );
+ return byteLength( filterFunction( val ) );
};
} else {
lengthFn = byteLength;
* function, if none, pass empty string.
* @param {string} newVal New value that may have to be trimmed down.
* @param {number} codePointLimit Number of characters the value may be in size.
- * @param {Function} [filterFn] Function to call on the string before assessing the length.
+ * @param {Function} [filterFunction] Function to call on the string before assessing the length.
* @return {Object}
* @return {string} return.newVal
* @return {boolean} return.trimmed
*/
- function trimCodePointLength( safeVal, newVal, codePointLimit, filterFn ) {
+ function trimCodePointLength( safeVal, newVal, codePointLimit, filterFunction ) {
var lengthFn;
- if ( filterFn ) {
+ if ( filterFunction ) {
lengthFn = function ( val ) {
- return codePointLength( filterFn( val ) );
+ return codePointLength( filterFunction( val ) );
};
} else {
lengthFn = codePointLength;