2 added 125 characters in body
source | link
ClearAll[foo];
foo[x : {___List?(VectorQ[#, NumberQ] &)}] := Plus @@@ x

foo[{{1, 2}, {2, 3, 4}}]

{3, 9}

foo[{{1, 2}, {{3}}}]

foo[{{1, 2}, {{3}}}]

Note: You need to use NumericQ in place of NumberQ if you want foo[{{1, 2}, {2, 3, π}}] to return {3, 2 + 3 π}.

ClearAll[foo];
foo[x : {___List?(VectorQ[#, NumberQ] &)}] := Plus @@@ x

foo[{{1, 2}, {2, 3, 4}}]

{3, 9}

foo[{{1, 2}, {{3}}}]

foo[{{1, 2}, {{3}}}]

ClearAll[foo];
foo[x : {___List?(VectorQ[#, NumberQ] &)}] := Plus @@@ x

foo[{{1, 2}, {2, 3, 4}}]

{3, 9}

foo[{{1, 2}, {{3}}}]

foo[{{1, 2}, {{3}}}]

Note: You need to use NumericQ in place of NumberQ if you want foo[{{1, 2}, {2, 3, π}}] to return {3, 2 + 3 π}.

1
source | link

ClearAll[foo];
foo[x : {___List?(VectorQ[#, NumberQ] &)}] := Plus @@@ x

foo[{{1, 2}, {2, 3, 4}}]

{3, 9}

foo[{{1, 2}, {{3}}}]

foo[{{1, 2}, {{3}}}]