counterpart icon indicating copy to clipboard operation
counterpart copied to clipboard

Fallback does not work with string '0'

Open awjreynolds opened this issue 9 years ago • 1 comments

I've had to put this check in place to handle strings that are 0 and enable fallback to work successfully.

return label === '0' ? counterpart(table.columns.${label}, { fallback: label }) : label;

awjreynolds avatar Nov 09 '16 15:11 awjreynolds

Hi @awjreynolds,

I'm afraid I can't reproduce your issue. Adding a test like this

assert.equal('bar', counterpart('foo.0', { fallback: 'bar' }));

does work for me.

Please send me a bit more code, preferably as a failing spec.

martinandert avatar Nov 12 '16 15:11 martinandert