UNPKG

tdesign-mobile-vue

Version:
37 lines (29 loc) 887 B
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _typeof = require('@babel/runtime/helpers/typeof'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof); function findIndex(v, set) { var reg = new RegExp("^".concat(!v && v !== 0 ? "" : v, "$")); var arr = toArray(set); return arr.findIndex(function (s) { return reg.test(s); }); } function isFalsy(v) { return !v && v !== 0; } function toArray(v) { if (isFalsy(v)) return []; if (_typeof__default["default"](v) === "object") return Array.from(v); return [v]; } exports.findIndex = findIndex; exports.isFalsy = isFalsy; exports.toArray = toArray; //# sourceMappingURL=util.js.map