Files
NSG_PORTAL_V2/utils/resourceHandler.ts
T
2024-07-06 18:29:38 +07:00

20 lines
418 B
TypeScript

import * as cherrio from 'cheerio'
const getResource = (key: any, data: any) => {
const $ = cherrio.load(`<div class="">${data}</div>`)
let result = null;
switch (key) {
case 'HIGHLIGHT_VIDEO':
result = $('video').first().parent().html();
break;
default:
result = $.html();
}
console.log(result)
return result;
}
export {
getResource
}