@twin.org/api-tenant-processor
Version:
API Tenant Processor for converting and api key to a tenant id.
27 lines • 778 B
JavaScript
import { Guards } from "@twin.org/core";
/**
* Context Id handler for testing as a tenant id.
*/
export class TenantIdContextIdHandler {
/**
* Runtime name for the class.
*/
static CLASS_NAME = "TenantIdContextIdHandler";
/**
* The short form of the tenant id is the same as the full version.
* @param value The full context id value.
* @returns Short form string.
*/
short(value) {
return value;
}
/**
* Guard the value ensuring length.
* @param value The value to guard.
* @throws GeneralError if the value is too short.
*/
guard(value) {
Guards.stringHexLength(TenantIdContextIdHandler.CLASS_NAME, "value", value, 32);
}
}
//# sourceMappingURL=tenantIdContextIdHandler.js.map