function isIP(ipAddress, options = {}) {
  assertString(ipAddress);

  // accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])
  // eslint-disable-next-line prefer-rest-params
  const version = (typeof options === 'object' ? options.version : arguments[1]) || '';

  if (!version) {
    return isIP(ipAddress, { version: 4 }) || isIP(ipAddress, { version: 6 });
  }

  if (version.toString() === '4') {
    return IPv4AddressRegExp.test(ipAddress);
  }

  if (version.toString() === '6') {
    return IPv6AddressRegExp.test(ipAddress);
  }

  return false;
}
11.3.  Examples

   The following addresses

             fe80::1234 (on the 1st link of the node)
             ff02::5678 (on the 5th link of the node)
             ff08::9abc (on the 10th organization of the node)

   would be represented as follows:

             fe80::1234%1
             ff02::5678%5
             ff08::9abc%10

   (Here we assume a natural translation from a zone index to the
   <zone_id> part, where the Nth zone of any scope is translated into
   "N".)

   If we use interface names as <zone_id>, those addresses could also be
   represented as follows:

            fe80::1234%ne0
            ff02::5678%pvc1.3
            ff08::9abc%interface10

   where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
   to the 5th link, and "interface10" belongs to the 10th organization.
*