NG1NDEX
Server IP : 150.95.80.236  /  Your IP : 18.227.72.172
Web Server : Apache
System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : social-telecare ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/plugins/formvalidation/dist/amd/validators/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/plugins/formvalidation/dist/amd/validators/step.js
define(["require", "exports", "../utils/format"], function (require, exports, format_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function step() {
        var round = function (input, precision) {
            var m = Math.pow(10, precision);
            var x = input * m;
            var sign;
            switch (true) {
                case x === 0:
                    sign = 0;
                    break;
                case x > 0:
                    sign = 1;
                    break;
                case x < 0:
                    sign = -1;
                    break;
            }
            var isHalf = x % 1 === 0.5 * sign;
            return isHalf ? (Math.floor(x) + (sign > 0 ? 1 : 0)) / m : Math.round(x) / m;
        };
        var floatMod = function (x, y) {
            if (y === 0.0) {
                return 1.0;
            }
            var dotX = ("" + x).split('.');
            var dotY = ("" + y).split('.');
            var precision = (dotX.length === 1 ? 0 : dotX[1].length) + (dotY.length === 1 ? 0 : dotY[1].length);
            return round(x - y * Math.floor(x / y), precision);
        };
        return {
            validate: function (input) {
                if (input.value === '') {
                    return { valid: true };
                }
                var v = parseFloat(input.value);
                if (isNaN(v) || !isFinite(v)) {
                    return { valid: false };
                }
                var opts = Object.assign({}, {
                    baseValue: 0,
                    message: '',
                    step: 1,
                }, input.options);
                var mod = floatMod(v - opts.baseValue, opts.step);
                return {
                    message: (0, format_1.default)(input.l10n ? opts.message || input.l10n.step.default : opts.message, "" + opts.step),
                    valid: mod === 0.0 || mod === opts.step,
                };
            },
        };
    }
    exports.default = step;
});

Anon7 - 2022
AnonSec Team