-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent 'to: wrong argument' output caused by shelljs #128
Conversation
Thank you. I'm definitely OK with accommodating shell.js and its bad behavior solely because it's so commonly used. I like this hack.... I'm wondering though, does it make more sense to just hardcode the native string properties? That adds more to the payload, but it feels more correct. IDK, maybe what you have is good enough. Thoughts? |
This hack does allow adding own String.prototype properties ( which seems to me a bad idea but it is done i.e shelljs) since the current implementation wraps them if they were added before requiring string.js. Having said that, If adding hardcoded property does not break anything I think thats the way to go. |
is this going to get merged? |
Yeah, I'll do it now... give me a few mins... |
prevent 'to: wrong argument' output caused by shelljs
Published as |
@jprichardson I'm noticing a side affect with this. When this is executed with the shelljs's overload of to a file is written named |
Grrrr on shelljs. Would skipping the |
@jprichardson we can have a list of string prototype methods that we allow in stringjs instead of going through all String.prototype methods ( some of which can be non native ) and calling them with string arguments to determine if they return string or not. This approach should get rid of these kind of problems but might be a breaking change for people who are relying on stringjs to recognize string methods that they have added themselves and allow chaining. |
we need to skip both to and toEnd |
This fixes #127 although I am not entirely sure if we should do it or not.
@jprichardson thoughts ?