shelljs/global.js
Nate Fischer 6739aed69e refactor(string): modify string protoype, but only for shelljs/global
`require('shelljs/global')` extends String.prototype to have the `.to()` and
`.toEnd()` methods again. This also adds tests for the global require.
2016-03-18 17:05:14 -07:00

11 lines
295 B
JavaScript

var shell = require('./shell.js');
var common = require('./src/common');
for (var cmd in shell)
global[cmd] = shell[cmd];
var _to = require('./src/to');
String.prototype.to = common.wrap('to', _to);
var _toEnd = require('./src/toEnd');
String.prototype.toEnd = common.wrap('toEnd', _toEnd);