260322:1648 Correct Coresspondence / Doing RFA / Correct CI
This commit is contained in:
@@ -20,8 +20,10 @@ export class CryptoService {
|
||||
this.key = crypto.scryptSync(secret, 'salt', 32);
|
||||
}
|
||||
|
||||
encrypt(text: string | number | boolean): string {
|
||||
if (text === null || text === undefined) return text as any;
|
||||
encrypt(
|
||||
text: string | number | boolean | null | undefined
|
||||
): string | null | undefined {
|
||||
if (text === null || text === undefined) return text;
|
||||
|
||||
try {
|
||||
const stringValue = String(text);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AsyncLocalStorage } from 'async_hooks';
|
||||
|
||||
@Injectable({ scope: Scope.DEFAULT })
|
||||
export class RequestContextService {
|
||||
private static readonly cls = new AsyncLocalStorage<Map<string, any>>();
|
||||
private static readonly cls = new AsyncLocalStorage<Map<string, unknown>>();
|
||||
|
||||
static run(fn: () => void) {
|
||||
this.cls.run(new Map(), fn);
|
||||
@@ -21,7 +21,7 @@ export class RequestContextService {
|
||||
|
||||
static get<T>(key: string): T | undefined {
|
||||
const store = this.cls.getStore();
|
||||
return store?.get(key);
|
||||
return store?.get(key) as T | undefined;
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
@@ -6,9 +6,7 @@ import { UuidResolverService } from './uuid-resolver.service';
|
||||
// Mock uuid module to avoid ESM import issue with uuid@13
|
||||
jest.mock('uuid', () => ({
|
||||
validate: (str: string) =>
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
||||
str
|
||||
),
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(str),
|
||||
v7: () => '01912345-6789-7abc-8def-0123456789ab',
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user