tdesign-mobile-vue
Version:
tdesign-mobile-vue
243 lines (221 loc) • 6.79 kB
JavaScript
/**
* tdesign v1.7.0
* (c) 2024 TDesign Group
* @license MIT
*/
import './dep-8bf3054e.mjs';
import { _ as _arrayMap } from './dep-0d52e58f.mjs';
import { a as _arrayPush, _ as _baseClone, b as _getAllKeysIn } from './dep-6c53a3e4.mjs';
import { _ as _baseGet, a as _castPath, b as _toKey } from './dep-c51d4905.mjs';
import { _ as _baseSlice } from './dep-0ea7bbde.mjs';
import { i as isPlainObject_1, _ as _copyObject } from './dep-d2161895.mjs';
import { c as _Symbol$1 } from './dep-3d249f65.mjs';
import { i as isArguments_1 } from './dep-e57d46f3.mjs';
import { i as isArray_1 } from './dep-019e292f.mjs';
import './dep-32364550.mjs';
import { a as _overRest, b as _setToString } from './dep-ba131d9c.mjs';
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last$1(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
var last_1 = last$1;
var baseGet = _baseGet,
baseSlice = _baseSlice;
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent$1(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
var _parent = parent$1;
var castPath$1 = _castPath,
last = last_1,
parent = _parent,
toKey = _toKey;
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset$1(object, path) {
path = castPath$1(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
var _baseUnset = baseUnset$1;
var isPlainObject = isPlainObject_1;
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone$1(value) {
return isPlainObject(value) ? undefined : value;
}
var _customOmitClone = customOmitClone$1;
var _Symbol = _Symbol$1,
isArguments = isArguments_1,
isArray = isArray_1;
/** Built-in value references. */
var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable$1(value) {
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
}
var _isFlattenable = isFlattenable$1;
var arrayPush = _arrayPush,
isFlattenable = _isFlattenable;
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten$1(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten$1(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
var _baseFlatten = baseFlatten$1;
var baseFlatten = _baseFlatten;
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten$1(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
var flatten_1 = flatten$1;
var flatten = flatten_1,
overRest = _overRest,
setToString = _setToString;
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest$1(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
var _flatRest = flatRest$1;
var arrayMap = _arrayMap,
baseClone = _baseClone,
baseUnset = _baseUnset,
castPath = _castPath,
copyObject = _copyObject,
customOmitClone = _customOmitClone,
flatRest = _flatRest,
getAllKeysIn = _getAllKeysIn;
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function (object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function (path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
var omit_1 = omit;
export { _baseFlatten as _, _flatRest as a, omit_1 as o };
//# sourceMappingURL=dep-55c9adc0.mjs.map