/**
* @description Functions from N/config module encapsulated
* @type {{isProduction(): boolean}}
*/
const configFunction = {
/**
* To know whether the account is Production Environment or not
* @returns {boolean} true when account is Production, false in all other scenarios
*/
isProduction() {
var companyInfo = config.load({
type: config.Type.COMPANY_INFORMATION
});
var ns_companyid = companyInfo.getValue({
fieldId: 'companyid'
}).toString().trim().toLowerCase();
log.debug('ns_companyid', ns_companyid);
if (Number.isNaN(Number(ns_companyid))) //Will be NaN for Sandbox or Release Preview accounts
return false; // return false when script moved to production
return true;
}
};