Skip to content

Commit

Permalink
Merge pull request #15 from SpeedCurve-Metrics/hotfix/v303
Browse files Browse the repository at this point in the history
v303
  • Loading branch information
elenakondrateva authored Oct 12, 2022
2 parents 0742a45 + 87f4c6e commit 3b31660
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let LUX = (window.LUX as LuxGlobal) || {};
let scriptEndTime = scriptStartTime;

LUX = (function () {
const SCRIPT_VERSION = "302";
const SCRIPT_VERSION = "303";
const logger = new Logger();
const globalConfig = Config.fromObject(LUX);

Expand Down
12 changes: 9 additions & 3 deletions src/matching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Matching {
* @return RegExp
*/
static createRegexpFromPathname(pattern: string): RegExp {
const anyDomain:boolean = pattern.charAt(0) == "/";
const anyDomain: boolean = pattern.charAt(0) == "/";
pattern = this.escapeStringForRegexp(pattern);
const expression =
"^" +
Expand All @@ -55,8 +55,14 @@ export default class Matching {
* @return RegExp
*/
static getRegexpForExactString(string: string): RegExp {
const anyDomain:boolean = string.charAt(0) == "/";
return new RegExp("^" + (anyDomain ? Matching.domainExpression : "") + this.escapeStringForRegexp(string) + "/?$", "i");
const anyDomain: boolean = string.charAt(0) == "/";
return new RegExp(
"^" +
(anyDomain ? Matching.domainExpression : "") +
this.escapeStringForRegexp(string) +
"/?$",
"i"
);
}

/**
Expand Down

0 comments on commit 3b31660

Please sign in to comment.