All files / utils groupCustomPropertiesByCtx.js

100% Statements 6/6
80% Branches 4/5
100% Functions 2/2
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 1430x 4x 48x 48x       48x 48x          
const groupCustomPropertiesByCtx = (customProperties = []) => (
  customProperties.reduce((acc, curr) => {
    const ctx = curr.ctx ?? 'isNull';
    const returnObj = {
      ...acc
    };
 
    returnObj[ctx] = [...(acc?.[ctx] ?? []), curr];
    return returnObj;
  }, {})
);
 
export default groupCustomPropertiesByCtx;