Skip to content

Commit 6b139a9

Browse files
committed
Fixed an issue with wildcards.
1 parent 4bef5a5 commit 6b139a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Utils-spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ describe('Utils', () => {
9595
});
9696

9797
it('*Address', () => {
98-
debugger;
9998
let event = { type:'usage', source:'about' };
10099
expect(Utils.stringify(event, ['*Address'])).toBe(JSON.stringify(event));
101100
});

src/Utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export class Utils {
149149
}
150150

151151
if (startsWithWildcard) {
152-
return input.lastIndexOf(pattern) === (input.length - pattern.length);
152+
let lastIndexOf = input.lastIndexOf(pattern);
153+
return lastIndexOf !== -1 && lastIndexOf === (input.length - pattern.length);
153154
}
154155

155156
if (endsWithWildcard) {

0 commit comments

Comments
 (0)