Socket
Socket
Sign inDemoInstall

arcjet

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arcjet - npm Package Compare versions

Comparing version 1.0.0-alpha.18 to 1.0.0-alpha.19

16

index.js

@@ -73,2 +73,9 @@ import { ArcjetRuleResult, ArcjetEmailReason, ArcjetBotType, ArcjetErrorReason, ArcjetBotReason, ArcjetErrorDecision, ArcjetReason, ArcjetDenyDecision } from '@arcjet/protocol';

}
function isEmailType(type) {
return (type === "FREE" ||
type === "DISPOSABLE" ||
type === "NO_MX_RECORDS" ||
type === "NO_GRAVATAR" ||
type === "INVALID");
}
function toString(value) {

@@ -196,5 +203,6 @@ if (typeof value === "string") {

const allowDomainLiteral = opt.allowDomainLiteral ?? false;
const analyzeOpts = {
const emailOpts = {
requireTopLevelDomain,
allowDomainLiteral,
blockedEmails: block,
};

@@ -212,3 +220,4 @@ rules.push({

async protect(context, { email }) {
if (await analyze.isValidEmail(context, email, analyzeOpts)) {
const result = await analyze.isValidEmail(context, email, emailOpts);
if (result.validity === "valid") {
return new ArcjetRuleResult({

@@ -222,2 +231,3 @@ ttl: 0,

else {
const typedEmailTypes = result.blocked.filter(isEmailType);
return new ArcjetRuleResult({

@@ -228,3 +238,3 @@ ttl: 0,

reason: new ArcjetEmailReason({
emailTypes: ["INVALID"],
emailTypes: typedEmailTypes,
}),

@@ -231,0 +241,0 @@ });

@@ -185,2 +185,12 @@ import {

function isEmailType(type: string): type is ArcjetEmailType {
return (
type === "FREE" ||
type === "DISPOSABLE" ||
type === "NO_MX_RECORDS" ||
type === "NO_GRAVATAR" ||
type === "INVALID"
);
}
function toString(value: unknown) {

@@ -531,5 +541,6 @@ if (typeof value === "string") {

const analyzeOpts = {
const emailOpts = {
requireTopLevelDomain,
allowDomainLiteral,
blockedEmails: block,
};

@@ -559,3 +570,4 @@

): Promise<ArcjetRuleResult> {
if (await analyze.isValidEmail(context, email, analyzeOpts)) {
const result = await analyze.isValidEmail(context, email, emailOpts);
if (result.validity === "valid") {
return new ArcjetRuleResult({

@@ -568,2 +580,4 @@ ttl: 0,

} else {
const typedEmailTypes = result.blocked.filter(isEmailType);
return new ArcjetRuleResult({

@@ -574,3 +588,3 @@ ttl: 0,

reason: new ArcjetEmailReason({
emailTypes: ["INVALID"],
emailTypes: typedEmailTypes,
}),

@@ -577,0 +591,0 @@ });

24

package.json
{
"name": "arcjet",
"version": "1.0.0-alpha.18",
"version": "1.0.0-alpha.19",
"description": "Arcjet TypeScript and JavaScript SDK core",

@@ -43,18 +43,18 @@ "license": "Apache-2.0",

"dependencies": {
"@arcjet/analyze": "1.0.0-alpha.18",
"@arcjet/duration": "1.0.0-alpha.18",
"@arcjet/headers": "1.0.0-alpha.18",
"@arcjet/protocol": "1.0.0-alpha.18",
"@arcjet/runtime": "1.0.0-alpha.18"
"@arcjet/analyze": "1.0.0-alpha.19",
"@arcjet/duration": "1.0.0-alpha.19",
"@arcjet/headers": "1.0.0-alpha.19",
"@arcjet/protocol": "1.0.0-alpha.19",
"@arcjet/runtime": "1.0.0-alpha.19"
},
"devDependencies": {
"@arcjet/eslint-config": "1.0.0-alpha.18",
"@arcjet/rollup-config": "1.0.0-alpha.18",
"@arcjet/tsconfig": "1.0.0-alpha.18",
"@edge-runtime/jest-environment": "2.3.10",
"@arcjet/eslint-config": "1.0.0-alpha.19",
"@arcjet/rollup-config": "1.0.0-alpha.19",
"@arcjet/tsconfig": "1.0.0-alpha.19",
"@edge-runtime/jest-environment": "3.0.1",
"@jest/globals": "29.7.0",
"@rollup/wasm-node": "4.18.0",
"@rollup/wasm-node": "4.18.1",
"@types/node": "18.18.0",
"jest": "29.7.0",
"typescript": "5.5.2"
"typescript": "5.5.3"
},

@@ -61,0 +61,0 @@ "publishConfig": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc