How to use the spm-jquery.isArray function in spm-jquery

To help you get started, we’ve selected a few spm-jquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aralejs / validator / src / item.js View on Github external
}
                });
                truly = checked;
                break;
            default:
                truly = !!ele.val();
        }

        // 非必要且没有值的时候, 直接 callback
        if (!truly) {
            callback && callback(null, null);
            return;
        }
    }

    if (!$.isArray(rules))
        throw new Error('No validation rule specified or not specified as an array.');

    var tasks = [];

    $.each(rules, function (i, item) {
        var obj = utils.parseRule(item),
            ruleName = obj.name,
            param = obj.param;

        var ruleOperator = Rule.getOperator(ruleName);
        if (!ruleOperator)
            throw new Error('Validation rule with name "' + ruleName + '" cannot be found.');

        var options = getMsgOptions(param, ruleName, self);

        tasks.push(function (cb) {
github aralejs / validator / src / rule.js View on Github external
$.each(name, function (i, v) {
            if ($.isArray(v))
                addRule(i, v[0], v[1]);
            else
                addRule(i, v);
        });
        return this;

spm-jquery

JavaScript library for DOM operations

MIT
Latest version published 9 years ago

Package Health Score

69 / 100
Full package analysis