include()函数不适用于不区分大小写的搜索数据

时间:2019-05-10 10:28:10

标签: javascript angular typescript

我想搜索不区分大小写的数据以及数字。在include()函数中 allTickets中的所有数据,搜索值位于searchItem

var filtered = _.mapValues(allTickets, statuses =>
    _.filter(statuses, statusT =>
        _.some(statusT, T => {
            if (typeof(T) === "string") {
                let colData = T.toLowerCase();
                let searchData = searchItem.toLowerCase();
                _.includes(colData, searchData)
                console.log(colData, "true Stirng", searchData);
            } else {
                _.includes(T, searchItem)
                console.log("true number ");

            }
        })
    )
)

0 个答案:

没有答案