Skip to content

Don't modify string prototype #159

@patrickarlt

Description

@patrickarlt

Ran into an issue debugging an issue with a coworker.

If the string module is included anywhere downstream of shelljs you get a pair of warnings.

to: wrong arguments

toEnd: wrong arguments

Here is the script to duplicate the issue.

var shelljs = require('shelljs');
var S = require('string');

// will produce output...

This has already been caught by several other issues...

Since shelljs is so heavily relied upon it might be a better to not modify the global String prototype.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions