"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateNumber = exports.validateBigInt = exports.validateBuffer = void 0;
const validateBuffer = (value, key, className, expectedLength) => {
    if (value === undefined)
        throw Error(`${className} ${key} is undefined`);
    if (value.length === 0)
        throw Error(`${className} ${key} length cannot be 0`);
    if (expectedLength && value.length !== expectedLength)
        throw Error(`${className} ${key} length expected to be ${expectedLength}`);
};
exports.validateBuffer = validateBuffer;
const validateBigInt = (value, key, className) => {
    if (value === undefined)
        throw Error(`${className} ${key} is undefined`);
    if (typeof value !== 'bigint')
        throw Error(`${className} ${key} must be type bigint`);
    if (value === BigInt(0))
        throw Error(`${className} ${key} must be greater than 0`);
};
exports.validateBigInt = validateBigInt;
const validateNumber = (value, key, className) => {
    if (value === undefined)
        throw Error(`${className} ${key} is undefined`);
    if (typeof value !== 'number')
        throw Error(`${className} ${key} must be type number`);
    if (value === 0)
        throw Error(`${className} ${key} must be greater than 0`);
};
exports.validateNumber = validateNumber;
//# sourceMappingURL=validate.js.map