mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-30 17:54:28 +02:00
almost can do tests
This commit is contained in:
parent
565142048c
commit
ddf399e099
10 changed files with 288 additions and 163 deletions
|
@ -1,5 +1,24 @@
|
|||
var _ = require('underscore');
|
||||
|
||||
exports.isBrowser = function() {
|
||||
var inBrowser = String(typeof window) !== 'undefined';
|
||||
return inBrowser;
|
||||
};
|
||||
|
||||
|
||||
exports.splitTextCommand = function(value, func, context) {
|
||||
func = _.bind(func, context);
|
||||
_.each(value.split(';'), function(command, index) {
|
||||
command = _.escape(command);
|
||||
command = command
|
||||
.replace(/^(\s+)/, '')
|
||||
.replace(/(\s+)$/, '')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'");
|
||||
|
||||
if (index > 0 && !command.length) {
|
||||
return;
|
||||
}
|
||||
func(command);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue