Skip to content

refactor(string): modify string protoype, but only for shelljs/global#401

Merged
ariporad merged 1 commit intomasterfrom
string-prototype
Mar 19, 2016
Merged

refactor(string): modify string protoype, but only for shelljs/global#401
ariporad merged 1 commit intomasterfrom
string-prototype

Conversation

@nfischer
Copy link
Copy Markdown
Member

require('shelljs/global') extends String.prototype to have the .to() and .toEnd() methods again. This also adds tests for the global require.

This is along the lines of the discussion in #398. The advantage of this is that ShellJS is still backwards compatible for require('shelljs/global'), but we still have an option to avoid extending the String prototype (just use require('shelljs') instead). This would make things more convenient (and global is a convenience script primarily), and would ease the transition to ShellJS v0.7.

`require('shelljs/global')` extends String.prototype to have the `.to()` and
`.toEnd()` methods again. This also adds tests for the global require.
@nfischer nfischer added this to the v0.7.0 milestone Mar 19, 2016
@ariporad
Copy link
Copy Markdown
Contributor

LGTM!

ariporad added a commit that referenced this pull request Mar 19, 2016
refactor(string): modify string protoype, but only for shelljs/global
@ariporad ariporad merged commit f04170e into master Mar 19, 2016
@ariporad ariporad deleted the string-prototype branch March 19, 2016 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants