Skip to content

Commit

Permalink
Fix for websites with constructor URL
Browse files Browse the repository at this point in the history
- Fix #11877.
  • Loading branch information
alexanderby committed Nov 13, 2023
1 parent 477d747 commit f011c0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/generators/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,25 +256,25 @@ function lookupConfigURLs(domain: string, index: ConfigIndex, getAllRecordURLs:
let recordIds: number[] = [];

// Common fix
if ('*' in index.domainLabels) {
if (index.domainLabels.hasOwnProperty('*')) {
recordIds = recordIds.concat(index.domainLabels['*']);
}

// Wildcard fixes
for (const label of labels) {
// We need to use in operator because ids are 0-based and 0 is falsy
if (label in index.domainLabels) {
if (index.domainLabels.hasOwnProperty(label)) {
const currRecordIds = index.domainLabels[label];
lookupConfigURLsInDomainLabels(domain, recordIds, currRecordIds, getAllRecordURLs);
}
}

for (let i = 0; i < labels.length; i++) {
const substring = labels.slice(i).join('.');
if (substring in index.domains) {
if (index.domains.hasOwnProperty(substring)) {
recordIds = recordIds.concat(index.domains[substring]);
}
if (substring in index.domainLabels) {
if (index.domainLabels.hasOwnProperty(substring)) {
const currRecordIds = index.domainLabels[substring];
lookupConfigURLsInDomainLabels(domain, recordIds, currRecordIds, getAllRecordURLs);
}
Expand Down Expand Up @@ -307,7 +307,7 @@ function lookupConfigURLs(domain: string, index: ConfigIndex, getAllRecordURLs:
* @returns a single fix
*/
function getSiteFix<T extends SiteProps>(text: string, index: SitePropsIndex<T>, options: SitesFixesParserOptions<T>, id: number): Readonly<T> {
if (id in index.cacheSiteFix) {
if (index.cacheSiteFix.hasOwnProperty(id)) {
return index.cacheSiteFix[id];
}

Expand Down

0 comments on commit f011c0f

Please sign in to comment.