I have:
export enum SiteCodes {
'USA',
'CAN',
'GB'
}
export interface GetSkuItemsRequest {
siteCode: SiteCodes;
}
export default class GetSkuItems {
public event: APIGatewayProxyEvent;
private PARAMS_TO_PICK = [
'siteCode'
];
private validateParams(pickedParams: { [key: string]: string }){
const {
siteCode
} = pickedParams;
if (!siteCode) {
throw MISSING_PARAMS_ERROR;
}
}
}
What I want to do in the validateParams
is to ensure that the siteCode
in included in the enum of SiteCodes