@stackframe/stack-shared
Advanced tools
+6
-0
| # @stackframe/stack-shared | ||
| ## 2.8.6 | ||
| ### Patch Changes | ||
| - Various changes | ||
| ## 2.8.5 | ||
@@ -4,0 +10,0 @@ |
@@ -251,5 +251,32 @@ import * as yup from "yup"; | ||
| // eslint-disable-next-line no-restricted-syntax | ||
| export const strictEmailSchema = (message) => yupString().email(message).matches(/^[^.].*@.*\.[^.][^.]+$/, message); | ||
| export const strictEmailSchema = (message) => yupString().email(message).matches(/^[^.]+(\.[^.]+)*@.*\.[^.][^.]+$/, message); | ||
| // eslint-disable-next-line no-restricted-syntax | ||
| export const emailSchema = yupString().email(); | ||
| import.meta.vitest?.test('strictEmailSchema', ({ expect }) => { | ||
| const validEmails = [ | ||
| "a@example.com", | ||
| "abc@example.com", | ||
| "a.b@example.com", | ||
| "throwaway.mail+token@example.com", | ||
| "email-alt-dash@demo-mail.com", | ||
| "test-account@weird-domain.net", | ||
| "%!~&+{}=|`#@domain.test", | ||
| "admin@a.longtldexample", | ||
| ]; | ||
| for (const email of validEmails) { | ||
| expect(strictEmailSchema(undefined).validateSync(email)).toBe(email); | ||
| } | ||
| const invalidEmails = [ | ||
| "test@localhost", | ||
| "test@gmail", | ||
| "test@gmail.com.a", | ||
| "test@gmail.a", | ||
| "test.@example.com", | ||
| "test..test@example.com", | ||
| ".test@example.com", | ||
| ]; | ||
| for (const email of invalidEmails) { | ||
| expect(() => strictEmailSchema(undefined).validateSync(email)).toThrow(); | ||
| } | ||
| }); | ||
| // Request auth | ||
@@ -256,0 +283,0 @@ export const clientOrHigherAuthTypeSchema = yupString().oneOf(['client', 'server', 'admin']).defined(); |
+1
-1
| { | ||
| "name": "@stackframe/stack-shared", | ||
| "version": "2.8.5", | ||
| "version": "2.8.6", | ||
| "main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
711835
0.13%16452
0.16%33
3.13%