All files / 2_Function/1_Split ArrowFunction.js

50% Statements 20/40
0% Branches 0/10
4.76% Functions 1/21
50% Lines 20/40
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107    1x     1x         1x     1x     1x                                     1x     1x         1x     1x     1x             1x       1x           1x       1x       1x               1x       1x           1x       1x       1x            
export default function() {
  // No argument
  const arrowFunction01 = (
 
  ) => { return "foo"; };
  const arrowFunction02 = (
 
  ) => {
    return "foo";
  };
  const arrowFunction03 = (
 
  ) => "foo";
  const arrowFunction04 = (
 
  ) => ({ foo: "bar" });
  const arrowFunction05 = (
 
  ) => ({
    foo: "bar"
  });
 
  // Highlighted range cannot be splitted.
  // // Single argument without parenthesis
  // const arrowFunction11 = foo => { return "foo"; };
  // const arrowFunction12 = foo => {
  //   return "foo";
  // };
  // const arrowFunction13 = foo => "foo";
  // const arrowFunction14 = foo => ({ foo: "bar" });
  // const arrowFunction15 = foo => ({
  //   foo: "bar"
  // });
 
  // Single argument with parenthesis
  const arrowFunction21 = (
    foo
    ) => { return "foo"; };
  const arrowFunction22 = (
    foo
    ) => {
    return "foo";
  };
  const arrowFunction23 = (
    foo
    ) => "foo";
  const arrowFunction24 = (
    foo
    ) => ({ foo: "bar" });
  const arrowFunction25 = (
    foo
    ) => ({
    foo: "bar"
  });
 
  // Multiple arguments
  const arrowFunction31 = (
    foo, 
    bar
    ) => { return "foo"; };
  const arrowFunction32 = (
    foo, 
    bar
    ) => {
    return "foo";
  };
  const arrowFunction33 = (
    foo, 
    bar
    ) => "foo";
  const arrowFunction34 = (
    foo, 
    bar
    ) => ({ foo: "bar" });
  const arrowFunction35 = (
    foo, 
    bar
    ) => ({
    foo: "bar"
  });
 
  // Arguments with default values
  const arrowFunction41 = (
    foo = "=>", 
    bar = "()"
    ) => { return "foo"; };
  const arrowFunction42 = (
    foo = "=>", 
    bar = "()"
    ) => {
    return "foo";
  };
  const arrowFunction43 = (
    foo = "=>", 
    bar = "()"
    ) => "foo";
  const arrowFunction44 = (
    foo = "=>", 
    bar = "()"
    ) => ({ foo: "bar" });
  const arrowFunction45 = (
    foo = "=>", 
    bar = "()"
    ) => ({
    foo: "bar"
  });
};