(es2015) named function-parameters in meteor - check?


#1

Hi guys,

what is best practise to implement a function with named parameters in meteor in combination with using check?

According to es6 docs this is possible to do:

function drawES6Chart({size = 'big', cords = { x: 0, y: 0 }, radius = 25} = {}) 
{
  // DOES THE CHECK() FUNCTION WORK?
  // WHAT is best practise to do this?
  check(size, String);
  console.log(size, cords, radius);
}

drawES6Chart({
  cords: { x: 18, y: 30 },
  radius: 30
});

So the question is: does check() work and is this best practise?


#2

Hi,
I dont understand the questions.

size is default value, so ‘big’ in that example.
So it is String.

What exactly should not be working there?