typeof expressions should be compared against valid strings JS-0028
Bug risk
Major
4 months ago3 years old
Invalid typeof comparison value
323
324    // Self is not defined within Node environments
325    // This check is needed because the user agent cannot be set in a browser
326    if (typeof self === undefined) {327      opts.headers = {
328        "User-Agent": `dhive/${packageVersion}`,
329      };
 86  },
 87
 88  is_digits: (is_digits = function (value) {
 89    if (typeof value === 'numeric') { 90      return true
 91    }
 92    return /^[0-9]+$/.test(value)