@apistudio/apim-cli
Version:
CLI for API Management Products
23 lines (22 loc) • 678 B
JavaScript
/**
* Copyright Super iPaaS Integration LLC, an IBM Company 2024
*/
const checkForNullOrUndefined = (obj, message) => {
if (obj === null || obj === undefined) {
throw new Error(message);
}
return obj;
};
const isNullOrUndefined = (obj) => {
return obj === null || obj === undefined;
};
const equalsIgnoreCase = (input1, input2) => {
if (isNullOrUndefined(input1) && isNullOrUndefined(input2)) {
return true;
}
if (isNullOrUndefined(input1) || isNullOrUndefined(input2)) {
return false;
}
return input1.toUpperCase() === input2.toUpperCase();
};
export { checkForNullOrUndefined, isNullOrUndefined, equalsIgnoreCase };