Cypress_TS/CyLukTs/lukan/node_modules/lodash/_baseTrim.js
Lukáš Kaňka ea3e372146 údržba
2023-08-15 18:35:50 +02:00

20 lines
444 B
JavaScript

var trimmedEndIndex = require('./_trimmedEndIndex');
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}
module.exports = baseTrim;