"use strict";
/*
 * @adonisjs/validator
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.array = void 0;
const helpers_1 = require("../../Validator/helpers");
const RULE_NAME = 'array';
const DEFAULT_MESSAGE = 'array validation failed';
/**
 * Ensure value is a valid array
 */
exports.array = {
    compile: (0, helpers_1.wrapCompile)(RULE_NAME),
    validate(value, _, { pointer, arrayExpressionPointer, errorReporter }) {
        if (!Array.isArray(value)) {
            errorReporter.report(pointer, RULE_NAME, DEFAULT_MESSAGE, arrayExpressionPointer);
        }
    },
};
