yas-process.js
392 Bytes
const getPname = (req) => {
let userAgent = req.get('User-Agent');
let isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent);
let isAndroid = /Android/i.test(userAgent);
let pName = '';
if (isiOS) {
pName = 'iFP_SalesPromotion';
}
if (isAndroid) {
pName = 'aFP_SalesPromotion';
}
return pName;
};
module.exports = {
getPname
};