Skip to content

Commit

Permalink
fix: use minimal RegExp matching for better performance (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
xixilive authored and daffl committed Sep 5, 2018
1 parent b5048e2 commit 3ca7e97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/commons/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Removes all leading and trailing slashes from a path
exports.stripSlashes = function stripSlashes (name) {
return name.replace(/^(\/*)|(\/*)$/g, '');
return name.replace(/^(\/+)|(\/+)$/g, '');
};

// A set of lodash-y utility functions that use ES6
Expand Down

0 comments on commit 3ca7e97

Please sign in to comment.