fix(core,testing): improve type safety and update tests for latest tstest and storage APIs

This commit is contained in:
2026-04-30 09:25:26 +00:00
parent 2e2726a4de
commit 45e24ecff3
19 changed files with 1394 additions and 1414 deletions
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartregistry',
version: '2.9.1',
version: '2.9.2',
description: 'A composable TypeScript library implementing OCI, NPM, Maven, Cargo, Composer, PyPI, and RubyGems registries for building unified container and package registries'
}
+6 -1
View File
@@ -6,7 +6,12 @@ import type { IRequestContext, IResponse, IAuthToken, IRequestActor } from './in
*/
export abstract class BaseRegistry {
protected getHeader(contextOrHeaders: IRequestContext | Record<string, string>, name: string): string | undefined {
const headers = 'headers' in contextOrHeaders ? contextOrHeaders.headers : contextOrHeaders;
const headers: Record<string, string> =
'headers' in contextOrHeaders &&
typeof contextOrHeaders.headers === 'object' &&
contextOrHeaders.headers !== null
? contextOrHeaders.headers
: contextOrHeaders as Record<string, string>;
if (headers[name] !== undefined) {
return headers[name];
}