We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export type Rule = | string | IfThenElseRule | AndRule | OrRule | ReturnRule | TryCatchRule | Rule[]; type RulesStrings = string | string[]; interface ReturnRule { return: RulesStrings } interface TryCatchRule { try: Rule, catch: Rule } interface IfThenElseRule { if: AndRule | OrRule | string then: Rule else?: Rule }
const validateRules = { isString: rule => typeof rule === 'string' && rule.length > 4, isStringOrStringList: rule => Array.isArray(rule) ? rule.every(validateRules.isString) : validateRules.isString(rule), isLogicalRule: rule => rule != null && ('and' in rule || 'or' in rule), isStructuralRule: rule => rule != null && ('if' in rule || 'and' in rule || 'or' in rule || 'map' in rule || 'reduce' in rule || 'filter' in rule || 'return' in rule), // TODO: add more combined rules to express higher order structures, constraints, etc }
#46 (comment)
#47 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Create unified Rule types & runtime check helpers
#46 (comment)
#47 (comment)
The text was updated successfully, but these errors were encountered: