dCBOR Pattern TypeScript - v1.0.0-alpha.20
    Preparing search index...

    Variable MatcherDefaultsConst

    MatcherDefaults: {
        paths(
            matcher: Pick<Matcher, "pathsWithCaptures">,
            haystack: Cbor,
        ): Path[];
        matches(matcher: Pick<Matcher, "paths">, haystack: Cbor): boolean;
        pathsWithCaptures(_haystack: Cbor): MatchWithCaptures;
        compile(_code: Instr[], _literals: Pattern[], _captures: string[]): void;
        collectCaptureNames(_names: string[]): void;
        isComplex(): boolean;
    } = ...

    Default implementation helpers for Matcher.

    Type Declaration

    • paths: function
      • Default paths implementation using pathsWithCaptures.

        Parameters

        • matcher: Pick<Matcher, "pathsWithCaptures">
        • haystack: Cbor

        Returns Path[]

    • matches: function
      • Default matches implementation using paths.

        Parameters

        • matcher: Pick<Matcher, "paths">
        • haystack: Cbor

        Returns boolean

    • pathsWithCaptures: function
    • compile: function
    • collectCaptureNames: function
      • Default collectCaptureNames does nothing.

        Parameters

        • _names: string[]

        Returns void

    • isComplex: function