adstxt-validator 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -587,7 +587,8 @@ async function validateWithOptimizedProvider(publisherDomain, records, provider,
587
587
  records.forEach((record) => {
588
588
  if (!record.is_valid)
589
589
  return; // Skip invalid records
590
- const domain = record.domain.toLowerCase();
590
+ // CRITICAL FIX: Normalize domain by trimming whitespace
591
+ const domain = record.domain.toLowerCase().trim();
591
592
  // Initialize arrays if not exists
592
593
  if (!domainToSellerIds.has(domain)) {
593
594
  domainToSellerIds.set(domain, []);
@@ -635,7 +636,8 @@ async function validateWithOptimizedProvider(publisherDomain, records, provider,
635
636
  if (!record.is_valid) {
636
637
  return record; // Skip invalid records
637
638
  }
638
- const domain = record.domain.toLowerCase();
639
+ // CRITICAL FIX: Normalize domain by trimming whitespace (must match the same normalization as above)
640
+ const domain = record.domain.toLowerCase().trim();
639
641
  const sellersMap = domainSellersMap.get(domain) || new Map();
640
642
  const metadata = domainMetadataMap.get(domain) || {};
641
643
  return await validateSingleRecordOptimized(record, publisherDomain, sellersMap, metadata, allEntries);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adstxt-validator",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "A TypeScript library for validating ads.txt files and sellers.json files",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",