babel-plugin-array-includes
babel-plugin-array-includes copied to clipboard
Does not translate Array.prototype.include calls when using x['includes'](y)
Kind of an edge case, but if you reference the includes
property using []
instead of .
, the plugin will not transform the code. Exampe:
x.includes(123);
x['includes'](123);
which should be identical in behaviour result in:
'use strict';
x.indexOf(123) !== -1;
x['includes'](123);
//# sourceMappingURL=test.js.map
Which I don't beleive is correct. Using babel-node confirms this:
> var x = [1,2,3]
undefined
> x.includes(1)
true
> x['includes'](1)
true
Would you like to try and fix this as well? cheers