bam-lambda
Version:
Serverless framework for AWS Lambda and API Gateway
12 lines (9 loc) • 373 B
JavaScript
module.exports = function getOption(options, optionType) {
const optionsObj = options || {};
return Object.keys(optionsObj).find((option) => {
const lowercaseOption = option.toLowerCase();
const lowercaseOptionType = optionType.toLowerCase();
return lowercaseOption === lowercaseOptionType
|| lowercaseOption === `${lowercaseOptionType}s`;
});
};