Skip to content

Commit

Permalink
fix tracking bug check
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed May 22, 2021
1 parent acf5196 commit f522b03
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/linter/test-support-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@ const { Logger } = require('./utils.js');
* @typedef {import('../../types').Identifier} Identifier
*/

/**
* @param {(string | string[])?} target
* @param {string} str
*/
function stringOrArrayIncludes(target, str) {
if (!target) {
return false;
}
if (Array.isArray(target)) {
return target.some(item => item.includes(str));
}
return target.includes(str);
}

/**
* @param {import('../../types.js').SimpleSupportStatement} statement
*/
function includesTrackingBug(statement) {
return (
statement.notes?.includes('crbug.com') ||
statement.notes?.includes('bugzil.la') ||
statement.notes?.includes('webkit.org/b/')
stringOrArrayIncludes(statement.notes, 'crbug.com') ||
stringOrArrayIncludes(statement.notes, 'bugzil.la') ||
stringOrArrayIncludes(statement.notes, 'webkit.org/b/')
);
}

Expand Down

0 comments on commit f522b03

Please sign in to comment.