Hi guys,
Two problems:
- it considers the array as an object and replace number with the value at the index of the array;
- it mutates the array and starts adding properties to it.
Here is a test case:
var getSlug = require('speakingurl');
const custom = ['b'];
const slug = getSlug('0', { custom });
console.log(slug); // => 'b', '0' has been replaced with the custom char at index 0
console.log(custom); // => [ 'b', b: 'b' ] the array has been mutated and now have a `b` property