UNPKG

@valkyriestudios/validator

Version:

A lightweight configurable javascript validator

19 lines (18 loc) 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.vGreaterThanOrEqual = vGreaterThanOrEqual; exports.default = vGreaterThanOrEqual; function vGreaterThanOrEqual(val, bound) { const n_bound = typeof bound === 'string' ? parseFloat(bound) : bound; if (!Number.isFinite(n_bound)) return false; if (typeof val === 'string' || Array.isArray(val)) { return val.length >= n_bound; } else if (val instanceof File || val instanceof Blob) { return val.size >= n_bound; } else { return Number.isFinite(val) && val >= n_bound; } }