All files / src/utils htmlProps.ts

100% Statements 6/6
100% Branches 4/4
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16    75x     7650x   7650x 74074x 36458x       7650x    
import isPropValid from '@emotion/is-prop-valid';
 
const omitProps = ['focusable', 'spacing', 'size', 'kind', 'orientation'];
 
export function pickHTMLProps<P extends object>(props: P) {
  const filteredProps: Partial<P> = {};
 
  for (const prop in props) {
    if (isPropValid(prop) && !omitProps.includes(prop)) {
      filteredProps[prop] = props[prop];
    }
  }
 
  return filteredProps;
}