Skip to content

Commit dd71452

Browse files
committed
Fix regex in getCommonBase (#107)
1 parent 77a9728 commit dd71452

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export module File {
7676
* Finds the common base path of two directories
7777
*/
7878
function getCommonBasePath(a: string, b: string) {
79-
const aSplit = a.split(/\\\//); // Split on '/' or '\'.
80-
const bSplit = b.split(/\\\//);
79+
const aSplit = a.split(/\\|\//); // Split on '/' or '\'.
80+
const bSplit = b.split(/\\|\//);
8181
let commonLength = 0;
8282
for (let i = 0; i < aSplit.length && i < bSplit.length; i++) {
8383
if (aSplit[i] !== bSplit[i]) break;

release/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ var File;
6161
* Finds the common base path of two directories
6262
*/
6363
function getCommonBasePath(a, b) {
64-
var aSplit = a.split(/\\\//); // Split on '/' or '\'.
65-
var bSplit = b.split(/\\\//);
64+
var aSplit = a.split(/\\|\//); // Split on '/' or '\'.
65+
var bSplit = b.split(/\\|\//);
6666
var commonLength = 0;
6767
for (var i = 0; i < aSplit.length && i < bSplit.length; i++) {
6868
if (aSplit[i] !== bSplit[i])

0 commit comments

Comments
 (0)