- export const canUseDOM = (): boolean => (
- !!(typeof window !== 'undefined' && window.document)
- );
- export const xmlParser = (xmlString: string): any => {
- const parser = new window.DOMParser();
- const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
- return xmlDoc;
- };
- export default canUseDOM;
|