mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 08:56:57 +01:00
19 lines
444 B
JavaScript
19 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;
|