ubdate
This commit is contained in:
11
node_modules/strip-outer/index.js
generated
vendored
Normal file
11
node_modules/strip-outer/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
var escapeStringRegexp = require('escape-string-regexp');
|
||||
|
||||
module.exports = function (str, sub) {
|
||||
if (typeof str !== 'string' || typeof sub !== 'string') {
|
||||
throw new TypeError();
|
||||
}
|
||||
|
||||
sub = escapeStringRegexp(sub);
|
||||
return str.replace(new RegExp('^' + sub + '|' + sub + '$', 'g'), '');
|
||||
};
|
||||
Reference in New Issue
Block a user