@jrc03c/email-validator
Advanced tools
Comparing version 0.0.4 to 0.0.5
(() => { | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
get: (a, b) => (typeof require !== "undefined" ? require : a)[b] | ||
}) : x)(function(x) { | ||
if (typeof require !== "undefined") | ||
return require.apply(this, arguments); | ||
throw new Error('Dynamic require of "' + x + '" is not supported'); | ||
}); | ||
var __commonJS = (cb, mod) => function __require2() { | ||
var __commonJS = (cb, mod) => function __require() { | ||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; | ||
}; | ||
// src/ugly-fetch.js | ||
var require_ugly_fetch = __commonJS({ | ||
"src/ugly-fetch.js"(exports, module) { | ||
var uglyFetch = (() => { | ||
if (typeof fetch !== "undefined") { | ||
return fetch; | ||
} else { | ||
try { | ||
const https = __require("https"); | ||
class Response { | ||
constructor(data) { | ||
this.data = data; | ||
} | ||
async text() { | ||
return this.data; | ||
} | ||
} | ||
return function fetch2(url) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
let data = ""; | ||
const request = https.get(url, (response) => { | ||
response.on("data", (d) => { | ||
data += d; | ||
}); | ||
response.on("end", () => { | ||
resolve(new Response(data)); | ||
}); | ||
}); | ||
request.on("error", (e) => { | ||
reject(e); | ||
}); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}); | ||
}; | ||
} catch (e) { | ||
throw new Error( | ||
"It doesn't seem like there's a `fetch` function available! This means that `EmailValidator` won't work since it needs to download a top-level domain list using a `fetch` function. Please import or define one before importing `EmailValidator`!" | ||
); | ||
} | ||
} | ||
})(); | ||
module.exports = uglyFetch; | ||
} | ||
}); | ||
// src/index.js | ||
var require_src = __commonJS({ | ||
"src/index.js"(exports, module) { | ||
var uglyFetch = require_ugly_fetch(); | ||
function flatten(x) { | ||
@@ -107,3 +51,3 @@ let out = []; | ||
} | ||
const response = await uglyFetch(url); | ||
const response = await fetch(url); | ||
const raw = await response.text(); | ||
@@ -110,0 +54,0 @@ const lines = raw.toLowerCase().split("\n"); |
{ | ||
"name": "@jrc03c/email-validator", | ||
"author": "jrc03c", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "validates email addresses", | ||
@@ -21,3 +21,3 @@ "license": "ISC", | ||
"eslint": "^8.40.0", | ||
"jest": "^27.5.1", | ||
"jest": "^29.5.0", | ||
"lodash": "^4.17.21", | ||
@@ -24,0 +24,0 @@ "prettier": "^2.8.8" |
@@ -1,3 +0,1 @@ | ||
const uglyFetch = require("./ugly-fetch") | ||
function flatten(x) { | ||
@@ -56,3 +54,3 @@ let out = [] | ||
const response = await uglyFetch(url) | ||
const response = await fetch(url) | ||
const raw = await response.text() | ||
@@ -59,0 +57,0 @@ const lines = raw.toLowerCase().split("\n") |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
2
19333
8
308