ianpaschal/aurora

View on GitHub
src/utils/hasItem.ts

Summary

Maintainability
A
0 mins
Test Coverage
// Aurora is distributed under the MIT license.

/**
 * @module utils
 */
export default function hasItem( target, array, prop ) {
    const match = array.find( ( item ) => {
        return item[ prop ] === target;
    });
    if ( !match ) {
        return false;
    }
    return true;
}