First commit

This commit is contained in:
2025-01-15 19:42:35 +01:00
committed by andreas
commit 6e1a5f9fe5
18475 changed files with 3309357 additions and 0 deletions
+11
View 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'), '');
};