import checkValuesMatched from './checkValuesMatched' ; function filterDatasByKeyValue < Key extends string > ( key ) { return ( value ) => < Data extends { [ key in Key ] : typeof value ; } > ( data ) => ( value ? data . filter ( d => checkValuesMatched ( value , d [ key ] ) ) : [ ] ) ; } export default filterDatasByKeyValue ;