@logto/core-kit
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -0,1 +1,3 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { type webcrypto } from 'node:crypto'; | ||
import { type DeepPartial } from '@silverhand/essentials'; | ||
@@ -140,3 +142,3 @@ import { z } from 'zod'; | ||
/** The Web Crypto API to use. By default, the global `crypto.subtle` will be used. */ | ||
protected readonly subtle: SubtleCrypto; | ||
protected readonly subtle: webcrypto.SubtleCrypto | SubtleCrypto; | ||
static symbols: "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ "; | ||
@@ -157,3 +159,3 @@ /** A set of characters that are considered as sequential. */ | ||
/** The Web Crypto API to use. By default, the global `crypto.subtle` will be used. */ | ||
subtle?: SubtleCrypto); | ||
subtle?: webcrypto.SubtleCrypto | SubtleCrypto); | ||
/** | ||
@@ -160,0 +162,0 @@ * Check if a password meets all the policy requirements. |
@@ -46,3 +46,3 @@ import { z } from 'zod'; | ||
*/ | ||
class PasswordPolicyChecker { | ||
export class PasswordPolicyChecker { | ||
static { this.symbols = Object.freeze('!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ '); } | ||
@@ -360,2 +360,1 @@ /** A set of characters that are considered as sequential. */ | ||
} | ||
export { PasswordPolicyChecker }; |
@@ -10,1 +10,3 @@ export declare const emailRegEx: RegExp; | ||
export declare const noSpaceRegEx: RegExp; | ||
/** Full domain that consists of at least 3 parts, e.g. foo.bar.com */ | ||
export declare const domainRegEx: RegExp; |
@@ -10,1 +10,3 @@ export const emailRegEx = /^\S+@\S+\.\S+$/; | ||
export const noSpaceRegEx = /^\S+$/; | ||
/** Full domain that consists of at least 3 parts, e.g. foo.bar.com */ | ||
export const domainRegEx = /^[\dA-Za-z]+(\.[\dA-Za-z]+){2,}$/; |
export * from './color.js'; | ||
export * from './regex.js'; | ||
export * from './url.js'; |
export * from './color.js'; | ||
export * from './regex.js'; | ||
export * from './url.js'; |
export declare const validateRedirectUrl: (url: string, type: 'web' | 'mobile') => boolean; | ||
export declare const validateUriOrigin: (url: string) => boolean; | ||
export declare const isValidUrl: (url?: string) => boolean; |
@@ -20,1 +20,9 @@ import { mobileUriSchemeProtocolRegEx, webRedirectUriProtocolRegEx } from '../regex.js'; | ||
}; | ||
export const isValidUrl = (url) => { | ||
try { | ||
return Boolean(url && new URL(url)); | ||
} | ||
catch { | ||
return false; | ||
} | ||
}; |
{ | ||
"name": "@logto/core-kit", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"author": "Silverhand Inc. <contact@silverhand.io>", | ||
@@ -29,7 +29,7 @@ "homepage": "https://github.com/logto-io/toolkit#readme", | ||
"engines": { | ||
"node": "^18.12.0" | ||
"node": "^20.9.0" | ||
}, | ||
"dependencies": { | ||
"@logto/language-kit": "^1.0.0", | ||
"@logto/shared": "^3.0.0", | ||
"@logto/language-kit": "^1.1.0", | ||
"@logto/shared": "^3.1.0", | ||
"color": "^4.2.3" | ||
@@ -42,12 +42,12 @@ }, | ||
"@jest/types": "^29.0.3", | ||
"@silverhand/eslint-config": "4.0.1", | ||
"@silverhand/essentials": "^2.8.4", | ||
"@silverhand/ts-config": "4.0.0", | ||
"@silverhand/ts-config-react": "4.0.0", | ||
"@silverhand/eslint-config": "5.0.0", | ||
"@silverhand/essentials": "^2.9.0", | ||
"@silverhand/ts-config": "5.0.0", | ||
"@silverhand/ts-config-react": "5.0.0", | ||
"@types/color": "^3.0.3", | ||
"@types/jest": "^29.4.0", | ||
"@types/node": "^18.11.18", | ||
"@types/node": "^20.9.5", | ||
"@types/react": "^18.0.31", | ||
"eslint": "^8.44.0", | ||
"jest": "^29.5.0", | ||
"jest": "^29.7.0", | ||
"lint-staged": "^15.0.0", | ||
@@ -58,3 +58,3 @@ "postcss": "^8.4.31", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0" | ||
"typescript": "^5.3.3" | ||
}, | ||
@@ -61,0 +61,0 @@ "eslintConfig": { |
Sorry, the diff of this file is not supported yet
78535
29
1129
Updated@logto/language-kit@^1.1.0
Updated@logto/shared@^3.1.0