Closed cezarsmpio closed 9 years ago
Was it an Array
or an Object
? If it was an array then just wrapping the split in an instance of check would work. My guess is that it is converted to an array somewhere before this, so it is already in the form you need without the split entirely.
I think the version of node or npm has changed the return of parameter to Object
, it was returning plugin-a, plugin-b, plugin-c
as object. I typed just console.log(typeof input)
and if the parameter is Object
or Array
the toString()
method will work in this case and the parameter input needs obligatorily a String
, check the doc of split: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Thanks.
Calling toString()
on a basic object will return '[Object object]', while calling it on an array will return the items separated by commas. I double checked in the console, so this must be an array. In which case just deleting the line should do just as well as this, or wrapping it in the check like I said above. If you cannot get to this today I can probably do it tonight.
In all tests, the return was [object Array]
, I used console.log(Object.prototype.toString.call(plugins));
, I don't quite understand the real problem, but using just toString()
solved my problem, in all tests.
I think you will improve better than me.
Thanks!
Any progress? Thanks!
Maybe it is something do with recent updates, but on the develop branch I am not getting this issue. If you get the chance to test it out and it is still there we can re-open this. Let me know!
Added the toString method, because the input parameter was returning a object.