UNPKG

@adguard/agtree

Version:
30 lines (27 loc) 731 B
/* * 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 { UNDERSCORE } from './constants.js'; /** * Validates the noop modifier (i.e. only underscores). * * @param value Value of the modifier. * * @returns True if the modifier is valid, false otherwise. */ const isValidNoopModifier = (value) => { const { length } = value; if (length === 0) { return false; } for (let i = 0; i < length; i += 1) { if (value[i] !== UNDERSCORE) { return false; } } return true; }; export { isValidNoopModifier };