1
0
Fork 0
mirror of synced 2024-09-18 10:20:11 +12:00
budibase/packages/frontend-core/node_modules/lodash/_baseTrim.js
2022-01-18 09:39:19 +00:00

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;