UNPKG

@adguard/agtree

Version:
37 lines (34 loc) 1.17 kB
/* * AGTree v3.2.2 (build date: Tue, 08 Jul 2025 13:39:47 GMT) * (c) 2025 Adguard Software Ltd. * Released under the MIT license * https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme */ import { COMMA, PIPE } from '../../utils/constants.js'; /** * Property map for binary serialization. This helps to reduce the size of the serialized data, * as it allows us to use a single byte to represent a property. * * ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}! * * @note Only 256 values can be represented this way. */ const DomainListMarshallingMap = { Separator: 1, Children: 2, Start: 3, End: 4, }; /** * Value map for binary serialization. This helps to reduce the size of the serialized data, * as it allows us to use a single byte to represent frequently used values. * * ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}! * * @note Only 256 values can be represented this way. */ const SEPARATOR_SERIALIZATION_MAP = new Map([ [COMMA, 0], [PIPE, 1], ]); export { DomainListMarshallingMap, SEPARATOR_SERIALIZATION_MAP };