/**
 * @since Last modified: 2024/06/25 10:06:36
 * @function findItems
 * @description Operate on the ax propperty of the node.
 * @param {number|string|HTMLElement|object} val  - Find item's search value.
 * @param {object[]} source  - Data sources.
 * @returns {undefined|object} - Return the search result.
 * @see {@link https://codepen.io/axui/pen/qBGKmKP|demo @ codepen}
 * @example
 * ax.findItems(0,[{a:0},{b:1}]);
 * <!--return {a:0}-->
 */
'use strict';
import findItem from './findItem';
import getDataType from './getDataType';
const findItems = (vals, source, key) => {
    let valsType = getDataType(vals), result = [], tmp = (valsType === 'String') ? vals.split(',') :
        (valsType === 'Array') ? vals : [vals];
    result = tmp.map((k) => findItem(k, source, key)).filter(Boolean);
    return result;
};
export default findItems;
