detect-is-it-html-or-xhtml 6.0.4 → 6.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2022 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2023 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -56,6 +56,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
56
56
 
57
57
  MIT License.
58
58
 
59
- Copyright © 2010-2022 Roy Revelt and other contributors.
59
+ Copyright © 2010-2023 Roy Revelt and other contributors.
60
60
 
61
61
  <p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name detect-is-it-html-or-xhtml
3
3
  * @fileoverview Does the string resemble an HTML or XHTML (or neither)?
4
- * @version 6.0.4
4
+ * @version 6.0.6
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/detect-is-it-html-or-xhtml/}
8
8
  */
9
9
 
10
- var i="6.0.4";var v=i;function T(t){function o(e){return e!=null}if(!t)return null;if(typeof t!="string")throw new TypeError(`detect-is-it-html-or-xhtml: [THROW_ID_01] Input must be a string! It was given as ${JSON.stringify(t,null,4)} (type ${typeof t})`);let m=/<\s*!\s*doctype[^>]*>/im,c=/<\s*img[^>]*>/gi,p=/<\s*br[^>]*>/gi,a=/<\s*hr[^>]*>/gi,d=/\/\s*>/g,s=t.match(m);if(s){let e=/xhtml/gi,l=/svg/gi;return s[0].match(e)||s[0].match(l)?"xhtml":"html"}let h=t.match(c)||[],u=t.match(p)||[],g=t.match(a)||[],r=h.concat(u).concat(g);if(r.length===0)return null;let n=0;for(let e=0,l=r.length;e<l;e++)o(r[e].match(d))&&(n+=1);return n>r.length/2?"xhtml":"html"}export{T as detectIsItHTMLOrXhtml,v as version};
10
+ var i="6.0.6";var v=i;function T(t){function o(e){return e!=null}if(!t)return null;if(typeof t!="string")throw new TypeError(`detect-is-it-html-or-xhtml: [THROW_ID_01] Input must be a string! It was given as ${JSON.stringify(t,null,4)} (type ${typeof t})`);let m=/<\s*!\s*doctype[^>]*>/im,c=/<\s*img[^>]*>/gi,p=/<\s*br[^>]*>/gi,a=/<\s*hr[^>]*>/gi,d=/\/\s*>/g,s=t.match(m);if(s){let e=/xhtml/gi,l=/svg/gi;return s[0].match(e)||s[0].match(l)?"xhtml":"html"}let h=t.match(c)||[],u=t.match(p)||[],g=t.match(a)||[],r=h.concat(u).concat(g);if(r.length===0)return null;let n=0;for(let e=0,l=r.length;e<l;e++)o(r[e].match(d))&&(n+=1);return n>r.length/2?"xhtml":"html"}export{T as detectIsItHTMLOrXhtml,v as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name detect-is-it-html-or-xhtml
3
3
  * @fileoverview Does the string resemble an HTML or XHTML (or neither)?
4
- * @version 6.0.4
4
+ * @version 6.0.6
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/detect-is-it-html-or-xhtml/}
8
8
  */
9
9
 
10
- "use strict";var detectIsItHtmlOrXhtml=(()=>{var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var l in e)c(t,l,{get:e[l],enumerable:!0})},b=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!v.call(t,r)&&r!==l&&c(t,r,{get:()=>e[r],enumerable:!(n=f(e,r))||n.enumerable});return t};var j=t=>b(c({},"__esModule",{value:!0}),t);var M={};T(M,{detectIsItHTMLOrXhtml:()=>I,version:()=>w});var a="6.0.4";var w=a;function I(t){function e(s){return s!=null}if(!t)return null;if(typeof t!="string")throw new TypeError(`detect-is-it-html-or-xhtml: [THROW_ID_01] Input must be a string! It was given as ${JSON.stringify(t,null,4)} (type ${typeof t})`);let l=/<\s*!\s*doctype[^>]*>/im,n=/<\s*img[^>]*>/gi,r=/<\s*br[^>]*>/gi,d=/<\s*hr[^>]*>/gi,h=/\/\s*>/g,o=t.match(l);if(o){let s=/xhtml/gi,m=/svg/gi;return o[0].match(s)||o[0].match(m)?"xhtml":"html"}let u=t.match(n)||[],g=t.match(r)||[],x=t.match(d)||[],i=u.concat(g).concat(x);if(i.length===0)return null;let p=0;for(let s=0,m=i.length;s<m;s++)e(i[s].match(h))&&(p+=1);return p>i.length/2?"xhtml":"html"}return j(M);})();
10
+ "use strict";var detectIsItHtmlOrXhtml=(()=>{var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var l in e)c(t,l,{get:e[l],enumerable:!0})},b=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!v.call(t,r)&&r!==l&&c(t,r,{get:()=>e[r],enumerable:!(n=f(e,r))||n.enumerable});return t};var j=t=>b(c({},"__esModule",{value:!0}),t);var M={};T(M,{detectIsItHTMLOrXhtml:()=>I,version:()=>w});var a="6.0.6";var w=a;function I(t){function e(s){return s!=null}if(!t)return null;if(typeof t!="string")throw new TypeError(`detect-is-it-html-or-xhtml: [THROW_ID_01] Input must be a string! It was given as ${JSON.stringify(t,null,4)} (type ${typeof t})`);let l=/<\s*!\s*doctype[^>]*>/im,n=/<\s*img[^>]*>/gi,r=/<\s*br[^>]*>/gi,d=/<\s*hr[^>]*>/gi,h=/\/\s*>/g,o=t.match(l);if(o){let s=/xhtml/gi,m=/svg/gi;return o[0].match(s)||o[0].match(m)?"xhtml":"html"}let u=t.match(n)||[],g=t.match(r)||[],x=t.match(d)||[],i=u.concat(g).concat(x);if(i.length===0)return null;let p=0;for(let s=0,m=i.length;s<m;s++)e(i[s].match(h))&&(p+=1);return p>i.length/2?"xhtml":"html"}return j(M);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detect-is-it-html-or-xhtml",
3
- "version": "6.0.4",
3
+ "version": "6.0.6",
4
4
  "description": "Does the string resemble an HTML or XHTML (or neither)?",
5
5
  "keywords": [
6
6
  "check",