export default function foo (str = 'bar') { if (str === 'baz') { throw new Error('baz is not allowed'); } return str; }