Erik_
It's crazier than that. is-even requires 3 packages.
Mon Oct 18, 2021 2:44pm
68.129.13.241

It relies on another package called "is-odd".

This is the entire code for "is-even"
From: https://github.com/i-voted-for-trump/is-even/blob/master/index.js
/*!
 * is-even 
 *
 * Copyright (c) 2015, 2017, Jon Schlinkert.
 * Released under the MIT License.
 */

'use strict';

var isOdd = require('is-odd');

module.exports = function isEven(i) {
  return !isOdd(i);
};



Then "is-odd" relies on another package "isNumber"

From: https://github.com/i-voted-for-trump/is-odd/blob/master/index.js
/*!
 * is-odd 
 *
 * Copyright (c) 2015-2017, Jon Schlinkert.
 * Released under the MIT License.
 */

'use strict';

const isNumber = require('is-number');

module.exports = function isOdd(value) {
  const n = Math.abs(value);
  if (!isNumber(n)) {
    throw new TypeError('expected a number');
  }
  if (!Number.isInteger(n)) {
    throw new Error('expected an integer');
  }
  if (!Number.isSafeInteger(n)) {
    throw new Error('value exceeds maximum safe integer');
  }
  return (n % 2) === 1;
};



Then finally isNumber does a check to verify it's actually a number.
From: https://github.com/jonschlinkert/is-number/blob/master/index.js
/*!
 * is-number 
 *
 * Copyright (c) 2014-present, Jon Schlinkert.
 * Released under the MIT License.
 */

'use strict';

module.exports = function(num) {
  if (typeof num === 'number') {
    return num - num === 0;
  }
  if (typeof num === 'string' && num.trim() !== '') {
    return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  }
  return false;
};



It looks like it's the case of someone creating the packages while learning and never expecting them to blow up to the download size that they have. They actually removed is-even and is-odd from their main github page and marked the repositories with the following on their "i voted for trump" account:
"I created this in 2014, when I was learning how to program."


Agreed dates, times, and timezones are crazy complex. It gets worse the further back in time you go. I remember reading there was some drama recently with one of the main devs that maintains the main timezone database or something but I can't remember what it was about...

    • Wait, so there's an entire package that just divides by 2 an - Puckdropper, Tue Oct 12 2021 4:57am
      d tells you if the result has a remainder? (Or shoot, you can just look at the last bit. If 1, not even.) It would kinda make sense in C, where the package could handle different numbers and number types, but isn't a number in JS just a number? (Been a while since I've looked at JS.) One area... more
      • It's crazier than that. is-even requires 3 packages.- Erik_, Mon Oct 18 2021 2:44pm
        • Wow... You never know what people show they need. - Puckdropper, Sun Oct 24 2021 4:34am
          I guess that could be a good programming language feature. After all, you're better off with well used libraries than you are writing your own in most cases. (The number of "Apps" on Android that are rewritten versions of other apps--with no more features or even a different design is staggering. ... more
          • Most languages have a standard library or an equivalent but Javascript doesn't really have an official one. This leads to packages being created to fill this void. Which is fine, but sometimes people hijack these "standard" packages used by many and introduce vulnerabilities or malware into them on ... more
            • It's not too late... - Puckdropper, Mon Nov 01 2021 3:19am
              They just have to create an official standard library. It'd work kinda like CPAN: You don't get them included with the library but they're easily accessible from a trusted place.
  • Click here to receive daily updates
    "Forces act when not restrained" - Puckdropper