myna.js
function RuleTypeToRule(rule) {
        if (rule instanceof Rule)
            return rule;
        if (typeof (rule) === "string")
            return text(rule);
        if (typeof (rule) === "boolean")
            return rule ? Myna.truePredicate : Myna.falsePredicate;
        throw new Error("Invalid rule type: " + rule);
    }
function RuleTypeToRule(rule) {
        if (rule instanceof Rule)
            return rule;
        if (typeof (rule) === "string")
            return text(rule);
        if (typeof (rule) === "boolean")
            return rule ? Myna.truePredicate : Myna.falsePredicate;
        throw new Error("Invalid rule type: " + rule);
    }
function RuleTypeToRule ( rule ) { if ( rule instanceof Rule ) return rule ; if ( typeof ( rule ) === "string" ) return text ( rule ) ; if ( typeof ( rule ) === "boolean" ) return rule ? Myna . truePredicate : Myna . falsePredicate ; throw new Error ( "Invalid rule type: " + rule ) ; }
Given a RuleType returns an instance of a Rule.
Given a RuleType returns an instance of a Rule .