HEX
Server: Apache
System: Linux webd011.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: ezpgggd (105871)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/ezpgggd/www/wp-content/plugins/wallsio/shared/util.js
/**
 * Convert to int, return the fallback if it's not convertible
 *
 * @param value
 * @param fallback
 * @return {number}
 */
export function toInt(value, fallback) {
  const result = parseInt(value, 10);
  return isNaN(result) ? fallback : result;
}

/**
 * Return `1` for `true`, `0` for `false`
 *
 * @param value
 * @return {number}
 */
export function boolToInt(value) {
  return value ? 1 : 0;
}

/**
 * Determines whether an input is a *real* object
 *
 * typeof would also return "object" for `null`, regexes, etc. Therefore we need this workaround.
 *
 * Taken from underscore.js
 *
 * @param {*} obj
 *
 * @return {boolean}
 */
export function isObject(obj) {
  return obj === Object(obj);
}