MCPcopy
hub / github.com/lodash/lodash / baseTrim

Function baseTrim

lodash.js:1018–1022  ·  view source on GitHub ↗

* The base implementation of `_.trim`. * * @private * @param {string} string The string to trim. * @returns {string} Returns the trimmed string.

(string)

Source from the content-addressed store, hash-verified

1016 * @returns {string} Returns the trimmed string.
1017 */
1018 function baseTrim(string) {
1019 return string
1020 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
1021 : string;
1022 }
1023
1024 /**
1025 * The base implementation of `_.unary` without support for storing metadata.

Callers 2

toNumberFunction · 0.85
trimFunction · 0.85

Calls 1

trimmedEndIndexFunction · 0.85

Tested by

no test coverage detected