Socket
Socket
Sign inDemoInstall

@jrc03c/email-validator

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

60

dist/email-validator.js
(() => {
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");

4

package.json
{
"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")

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc