static createFromExisting()

in packages/azure-kusto-data/src/kustoTrustedEndpoints.ts [56:66]


    static createFromExisting(existing: FastSuffixMatcher | null, rules: MatchRule[] | null): FastSuffixMatcher | null {
        if (!existing || !Object.keys(existing.rules).length) {
            return new FastSuffixMatcher(rules);
        }

        if (!rules) {
            return existing;
        }

        return new FastSuffixMatcher(rules.concat(...Object.values(existing.rules)));
    }