beaugunderson/ip-address

Lodash repeat should be fed with a string, not a number

Closed this issue · 1 comments

We are using lodash-webpack-plugin to avoid including the whole lodash library in our bundle.
And we faced with pretty subtle bug when new Address4('10.0.10.0/24').startAddress().address returning 0.10.0.10.

After some debugging we found out that ip-address calls repeat function from lodash with a number as a first argument, when it supposed to be string.
Full lodash transforms types by default, but with lodash-webpack-plugin it's not included by default.

For now, we're adding coercions: true option to plugin, but I think ip-address should fix repeat helper call to conform to its arguments typing, and to safe other developers from shooting themselves in their feet.

@klimashkin fixed in 5.9.2, thanks for your patience :)

(and as an aside: i know of no surer way to shoot yourself in the foot than to use lodash-webpack-plugin; it was the cause of no fewer than 5 subtle issues for us before we removed it)