Afanasev_Stepan_PIbd-21_IP/ИП 2 лаба/node_modules/lodash/_baseTrim.js
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04: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;