Added the underscore node_module.
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
This commit is contained in:
21
node_modules/underscore/amd/_createEscaper.js
generated
vendored
Normal file
21
node_modules/underscore/amd/_createEscaper.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
define(['./keys'], function (keys) {
|
||||
|
||||
// Internal helper to generate functions for escaping and unescaping strings
|
||||
// to/from HTML interpolation.
|
||||
function createEscaper(map) {
|
||||
var escaper = function(match) {
|
||||
return map[match];
|
||||
};
|
||||
// Regexes for identifying a key that needs to be escaped.
|
||||
var source = '(?:' + keys(map).join('|') + ')';
|
||||
var testRegexp = RegExp(source);
|
||||
var replaceRegexp = RegExp(source, 'g');
|
||||
return function(string) {
|
||||
string = string == null ? '' : '' + string;
|
||||
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
|
||||
};
|
||||
}
|
||||
|
||||
return createEscaper;
|
||||
|
||||
});
|
Reference in New Issue
Block a user