tdesign-mobile-vue
Version:
tdesign-mobile-vue
72 lines (64 loc) • 1.86 kB
JavaScript
/**
* tdesign v1.9.3
* (c) 2025 TDesign Group
* @license MIT
*/
;
var _baseGetTag = require('./dep-2f809ed9.js');
var _arrayMap = require('./dep-ae809b86.js');
var isArray = require('./dep-757b152c.js');
var isSymbol = require('./dep-2b08c0a6.js');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = _baseGetTag._Symbol ? _baseGetTag._Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray.isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return _arrayMap.arrayMap(value, baseToString) + '';
}
if (isSymbol.isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
exports.toString = toString;
//# sourceMappingURL=dep-afa9f3f2.js.map