@adguard/diff-builder
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -9,2 +9,8 @@ # Diff Builder Changelog | ||
## [1.0.3] - 2023-12-20 | ||
### Fixed | ||
- Recalculate only first found checksum. | ||
## [1.0.2] - 2023-12-20 | ||
@@ -11,0 +17,0 @@ |
{ | ||
"name": "@adguard/diff-builder", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A tool for generating differential updates for filter lists.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
import { createLogger } from '../common/create-logger'; | ||
import { findAndUpdateTag, removeTag } from './tags'; | ||
import { createTag, findAndUpdateTag, removeTag } from './tags'; | ||
@@ -328,13 +328,11 @@ const DEFAULT_PATCH_TTL_SECONDS = 60 * 60 * 24 * 7; | ||
// Remove checksum tag, because we changed filter's content via adding | ||
// Diff-Path tag, so we need to recalculate checksum. | ||
// Remove first found checksum tag, because we changed filter's content | ||
// via adding Diff-Path tag, so we need to recalculate checksum. | ||
updatedFilter = removeTag(CHECKSUM_TAG, updatedFilter); | ||
// Calculate checksum for new filter and update it in the filter. | ||
// Calculate checksum for new filter and insert it in the filter | ||
// to the first line. | ||
const updatedChecksum = calculateChecksumMD5(updatedFilter.join('')); | ||
updatedFilter = findAndUpdateTag( | ||
CHECKSUM_TAG, | ||
updatedChecksum, | ||
updatedFilter, | ||
); | ||
const checksumTag = createTag(CHECKSUM_TAG, updatedChecksum); | ||
updatedFilter.unshift(checksumTag); | ||
@@ -341,0 +339,0 @@ return updatedFilter; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
345986
7079