@adguard/agtree
Version:
Tool set for working with adblock filter lists
22 lines (19 loc) • 807 B
JavaScript
/*
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
* (c) 2025 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
import { getSyntaxSerializationMap } from '../marshalling-utils/syntax-serialization-map.js';
/**
* Value map for binary deserialization. This helps to reduce the size of the serialized data,
* as it allows us to use a single byte to represent frequently used values.
*/
let syntaxDeserializationMap;
const getSyntaxDeserializationMap = () => {
if (!syntaxDeserializationMap) {
syntaxDeserializationMap = new Map(Array.from(getSyntaxSerializationMap(), ([key, value]) => [value, key]));
}
return syntaxDeserializationMap;
};
export { getSyntaxDeserializationMap };