edgeport - v1.0.3
    Preparing search index...

    Function escapeFilterValue

    • Escapes a value for safe interpolation into an RFC 4515 filter string.

      Replaces the assertion-value metacharacters -- \, *, (, ), and the NUL byte -- with their \xx hex escapes (\5c, \2a, \28, \29, \00). Use this only when building a filter string by hand; the structured builders (eq, contains, ...) are already injection-safe and must not be combined with this (it would double-escape).

      Parameters

      • value: string

        The raw assertion value.

      Returns string

      The escaped value, safe to splice between an operator and a ).

      1.0.2

      const f = `(cn=${escapeFilterValue('a*b(c)')})`; // (cn=a\2ab\28c\29)