From a0c026d5c1b8ddcc1247510bd2e771f80dcf5af2 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Mon, 2 Sep 2024 16:56:55 +0200 Subject: [PATCH] 1.0.3 --- dist/browser.min.js | 2 +- dist/browser.min.js.map | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/index.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/browser.min.js b/dist/browser.min.js index 0a8517d..8fdd518 100644 --- a/dist/browser.min.js +++ b/dist/browser.min.js @@ -1,2 +1,2 @@ -(()=>{var e={44:(e,t,i)=>{const{version:s}=i(330),n=/^[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~](\.?[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;e.exports={test:e=>{if(!e||e.includes("*"))return!1;const[t,i]=e.split("@");return!(!t||!i||t.length>64||i.length>255)&&!(!function(e){if(e.startsWith(".")||e.endsWith("."))return!1;let t=null;for(const i of e){if("."===i&&"."===t)return!1;t=i}return!0}(t)||!function(e){const t=e.split(".");for(const e of t)if(0===e.length||e.length>63||e.startsWith("-")||e.endsWith("-"))return!1;return!0}(i))&&n.test(e)},version:s}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"@sefinek/email-validator","version":"1.0.1","description":"Lightweight npm module for email address validation.","keywords":["email","validation","validator","syntax","email-verify","email-verifier","email-checker","email-address-validator"],"homepage":"https://github.com/sefinek24/email-validator#readme","bugs":{"url":"https://github.com/sefinek24/email-validator/issues"},"repository":{"type":"git","url":"git+https://github.com/sefinek24/email-validator.git"},"license":"MIT","author":"Sefinek (https://sefinek.net)","main":"src/index.js","typings":"src/index.d.ts","scripts":{"test":"jest","up":"ncu -u && npm install && npm update && npm audit fix","build":"webpack --config webpack.config.js"},"devDependencies":{"jest":"^29.7.0","webpack":"^5.91.0","webpack-cli":"^5.1.4"}}')}},t={},i=function i(s){var n=t[s];if(void 0!==n)return n.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,i),r.exports}(44);window.emailValidator=i})(); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.emailValidator=e():t.emailValidator=e()}(this,(()=>{return t={44:t=>{const e=/^[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~](\.?[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.exports={test:t=>{if(!t||t.includes("*"))return!1;const[r,o]=t.split("@");return!(!r||!o||r.length>64||o.length>255)&&!(!(t=>{if(t.startsWith(".")||t.endsWith("."))return!1;let e=null;for(const r of t){if("."===r&&"."===e)return!1;e=r}return!0})(r)||!(t=>{const e=t.split(".");for(const t of e)if(0===t.length||t.length>63||t.startsWith("-")||t.endsWith("-"))return!1;return!0})(o))&&e.test(t)},version:"1.0.3"}}},e={},function r(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,r),s.exports}(44);var t,e})); //# sourceMappingURL=browser.min.js.map \ No newline at end of file diff --git a/dist/browser.min.js.map b/dist/browser.min.js.map index f4c9ed5..94146d0 100644 --- a/dist/browser.min.js.map +++ b/dist/browser.min.js.map @@ -1 +1 @@ -{"version":3,"file":"browser.min.js","mappings":"0BAAA,MAAM,QAAEA,GAAY,EAAQ,KACtBC,EAAa,oIAuBnBC,EAAOC,QAAU,CAChBC,KAAMC,IACL,IAAKA,GAASA,EAAMC,SAAS,KAAM,OAAO,EAE1C,MAAOC,EAAWC,GAAUH,EAAMI,MAAM,KACxC,SAAKF,IAAcC,GAAUD,EAAUG,OAAS,IAAMF,EAAOE,OAAS,SA1BxE,SAA0BH,GACzB,GAAIA,EAAUI,WAAW,MAAQJ,EAAUK,SAAS,KAAM,OAAO,EAEjE,IAAIC,EAAW,KACf,IAAK,MAAMC,KAAQP,EAAW,CAC7B,GAAa,MAATO,GAA6B,MAAbD,EAAkB,OAAO,EAC7CA,EAAWC,CACZ,CAEA,OAAO,CACR,CAkBOC,CAAiBR,KAhBxB,SAAuBC,GACtB,MAAMQ,EAAcR,EAAOC,MAAM,KACjC,IAAK,MAAMQ,KAAQD,EAClB,GAAoB,IAAhBC,EAAKP,QAAgBO,EAAKP,OAAS,IAAMO,EAAKN,WAAW,MAAQM,EAAKL,SAAS,KAAM,OAAO,EAGjG,OAAO,CACR,CASuCM,CAAcV,KAE5CP,EAAWG,KAAKC,EAAM,EAE9BL,U,+1BClCGmB,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAapB,QAGrB,IAAID,EAASiB,EAAyBG,GAAY,CAGjDnB,QAAS,CAAC,GAOX,OAHAsB,EAAoBH,GAAUpB,EAAQA,EAAOC,QAASkB,GAG/CnB,EAAOC,OACf,CCnB0BkB,CAAoB,I","sources":["webpack://emailValidator/./src/index.js","webpack://emailValidator/webpack/bootstrap","webpack://emailValidator/webpack/startup"],"sourcesContent":["const { version } = require('../package.json');\r\nconst MAIN_REGEX = /^[-!#$%&'*+\\\\/0-9=?A-Z^_a-z`{|}~](\\.?[-!#$%&'*+\\\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])+$/;\r\n\r\nfunction isValidLocalPart(localPart) {\r\n\tif (localPart.startsWith('.') || localPart.endsWith('.')) return false;\r\n\r\n\tlet prevChar = null;\r\n\tfor (const char of localPart) {\r\n\t\tif (char === '.' && prevChar === '.') return false;\r\n\t\tprevChar = char;\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nfunction isValidDomain(domain) {\r\n\tconst domainParts = domain.split('.');\r\n\tfor (const part of domainParts) {\r\n\t\tif (part.length === 0 || part.length > 63 || part.startsWith('-') || part.endsWith('-')) return false;\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nmodule.exports = {\r\n\ttest: email => {\r\n\t\tif (!email || email.includes('*')) return false;\r\n\r\n\t\tconst [localPart, domain] = email.split('@');\r\n\t\tif (!localPart || !domain || localPart.length > 64 || domain.length > 255) return false;\r\n\r\n\t\tif (!isValidLocalPart(localPart) || !isValidDomain(domain)) return false;\r\n\r\n\t\treturn MAIN_REGEX.test(email);\r\n\t},\r\n\tversion,\r\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(44);\n"],"names":["version","MAIN_REGEX","module","exports","test","email","includes","localPart","domain","split","length","startsWith","endsWith","prevChar","char","isValidLocalPart","domainParts","part","isValidDomain","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"browser.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,KACT,O,UCVA,MAAMC,EAAQ,oIAuBdJ,EAAOD,QAAU,CAChBM,KAAMC,IACL,IAAKA,GAASA,EAAMC,SAAS,KAAM,OAAO,EAE1C,MAAOC,EAAWC,GAAUH,EAAMI,MAAM,KACxC,SAAKF,IAAcC,GAAUD,EAAUG,OAAS,IAAMF,EAAOE,OAAS,SA1B/CH,KACxB,GAAIA,EAAUI,WAAW,MAAQJ,EAAUK,SAAS,KAAM,OAAO,EAEjE,IAAIC,EAAW,KACf,IAAK,MAAMC,KAAQP,EAAW,CAC7B,GAAa,MAATO,GAA6B,MAAbD,EAAkB,OAAO,EAC7CA,EAAWC,CACZ,CAEA,OAAO,CAAI,EAmBLC,CAAiBR,KAhBFC,KACrB,MAAMQ,EAAcR,EAAOC,MAAM,KACjC,IAAK,MAAMQ,KAAQD,EAClB,GAAoB,IAAhBC,EAAKP,QAAgBO,EAAKP,OAAS,IAAMO,EAAKN,WAAW,MAAQM,EAAKL,SAAS,KAAM,OAAO,EAGjG,OAAO,CAAI,EAU2BM,CAAcV,KAE5CL,EAAMC,KAAKC,EAAM,EAEzBc,QAAS,Q,GCjCNC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAazB,QAGrB,IAAIC,EAASqB,EAAyBE,GAAY,CAGjDxB,QAAS,CAAC,GAOX,OAHA2B,EAAoBH,GAAUvB,EAAQA,EAAOD,QAASuB,GAG/CtB,EAAOD,OACf,CCnB0BuB,CAAoB,I,MDF1CD,C","sources":["webpack://emailValidator/webpack/universalModuleDefinition","webpack://emailValidator/./src/index.js","webpack://emailValidator/webpack/bootstrap","webpack://emailValidator/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"emailValidator\"] = factory();\n\telse\n\t\troot[\"emailValidator\"] = factory();\n})(this, () => {\nreturn ","const REGEX = /^[-!#$%&'*+\\\\/0-9=?A-Z^_a-z`{|}~](\\.?[-!#$%&'*+\\\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])+$/;\r\n\r\nconst isValidLocalPart = localPart => {\r\n\tif (localPart.startsWith('.') || localPart.endsWith('.')) return false;\r\n\r\n\tlet prevChar = null;\r\n\tfor (const char of localPart) {\r\n\t\tif (char === '.' && prevChar === '.') return false;\r\n\t\tprevChar = char;\r\n\t}\r\n\r\n\treturn true;\r\n};\r\n\r\nconst isValidDomain = domain => {\r\n\tconst domainParts = domain.split('.');\r\n\tfor (const part of domainParts) {\r\n\t\tif (part.length === 0 || part.length > 63 || part.startsWith('-') || part.endsWith('-')) return false;\r\n\t}\r\n\r\n\treturn true;\r\n};\r\n\r\nmodule.exports = {\r\n\ttest: email => {\r\n\t\tif (!email || email.includes('*')) return false;\r\n\r\n\t\tconst [localPart, domain] = email.split('@');\r\n\t\tif (!localPart || !domain || localPart.length > 64 || domain.length > 255) return false;\r\n\r\n\t\tif (!isValidLocalPart(localPart) || !isValidDomain(domain)) return false;\r\n\r\n\t\treturn REGEX.test(email);\r\n\t},\r\n\tversion: '1.0.3' // TODO: Remember this\r\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(44);\n"],"names":["root","factory","exports","module","define","amd","this","REGEX","test","email","includes","localPart","domain","split","length","startsWith","endsWith","prevChar","char","isValidLocalPart","domainParts","part","isValidDomain","version","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8ddb243..c9aa4c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sefinek/email-validator", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@sefinek/email-validator", - "version": "1.0.2", + "version": "1.0.3", "license": "MIT", "devDependencies": { "@eslint/js": "^9.9.1", diff --git a/package.json b/package.json index 4db79b8..d29bbc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sefinek/email-validator", - "version": "1.0.2", + "version": "1.0.3", "description": "Lightweight npm module for email address validation.", "keywords": [ "email", diff --git a/src/index.js b/src/index.js index 267d3fb..f4ffe23 100644 --- a/src/index.js +++ b/src/index.js @@ -32,5 +32,5 @@ module.exports = { return REGEX.test(email); }, - version: '1.0.2' + version: '1.0.3' // TODO: Remember this }; \ No newline at end of file