kibana/x-pack/plugins/security_solution/common/detection_engine/utils.ts
Frank Hassanabad 2f017b0e85
[Security Solution][Detection Engine] Remove RuleTypeSchema in favor of Type for TypeScript (#76586)
## Summary

Removes RuleTypeSchema in favor of Type for TypeScript. Does break out one function called `parseScheduleDates` into its own file to remove a circular ref issue.
2020-09-02 21:48:41 -06:00

20 lines
749 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { EntriesArray } from '../shared_imports';
import { Type } from './schemas/common/schemas';
export const hasLargeValueList = (entries: EntriesArray): boolean => {
const found = entries.filter(({ type }) => type === 'list');
return found.length > 0;
};
export const hasNestedEntry = (entries: EntriesArray): boolean => {
const found = entries.filter(({ type }) => type === 'nested');
return found.length > 0;
};
export const isThresholdRule = (ruleType: Type) => ruleType === 'threshold';