detect-is-it-html-or-xhtml 6.0.24 → 6.1.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.1.0 (2025-10-15)
7
+
8
+ ### Features
9
+
10
+ - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
11
+
6
12
  ## 6.0.0 (2022-12-01)
7
13
 
8
14
  ### Bug Fixes
package/README.md CHANGED
@@ -46,7 +46,7 @@ assert.equal(
46
46
 
47
47
  ## Documentation
48
48
 
49
- Please [visit codsen.com](https://codsen.com/os/detect-is-it-html-or-xhtml/) for a full description of the API.
49
+ Please [visit codsen.com](https://codsen.com/os/detect-is-it-html-or-xhtml/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/detect-is-it-html-or-xhtml/CHANGELOG.md).
50
50
 
51
51
  ## Contributing
52
52
 
@@ -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.24
4
+ * @version 6.1.3
5
5
  * @author Roy Revelt
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.24";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 c=/<\s*!\s*doctype[^>]*>/im,m=/<\s*img[^>]*>/gi,p=/<\s*br[^>]*>/gi,a=/<\s*hr[^>]*>/gi,h=/\/\s*>/g,s=t.match(c);if(s){let e=/xhtml/gi,l=/svg/gi;return s[0].match(e)||s[0].match(l)?"xhtml":"html"}let d=t.match(m)||[],g=t.match(p)||[],u=t.match(a)||[],r=d.concat(g).concat(u);if(r.length===0)return null;let n=0;for(let e=0,l=r.length;e<l;e++)o(r[e].match(h))&&(n+=1);return n>r.length/2?"xhtml":"html"}export{T as detectIsItHTMLOrXhtml,v as version};
10
+ var i="6.1.3";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 c=/<\s*!\s*doctype[^>]*>/im,m=/<\s*img[^>]*>/gi,p=/<\s*br[^>]*>/gi,a=/<\s*hr[^>]*>/gi,h=/\/\s*>/g,s=t.match(c);if(s){let e=/xhtml/gi,l=/svg/gi;return s[0].match(e)||s[0].match(l)?"xhtml":"html"}let d=t.match(m)||[],g=t.match(p)||[],u=t.match(a)||[],r=d.concat(g).concat(u);if(r.length===0)return null;let n=0;for(let e=0,l=r.length;e<l;e++)o(r[e].match(h))&&(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.24
4
+ * @version 6.1.3
5
5
  * @author Roy Revelt
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 m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var l in e)m(t,l,{get:e[l],enumerable:!0})},b=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!v.call(t,r)&&r!==l&&m(t,r,{get:()=>e[r],enumerable:!(n=y(e,r))||n.enumerable});return t};var j=t=>b(m({},"__esModule",{value:!0}),t);var M={};T(M,{detectIsItHTMLOrXhtml:()=>I,version:()=>w});var a="6.0.24";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 ".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));let l=/<\s*!\s*doctype[^>]*>/im,n=/<\s*img[^>]*>/gi,r=/<\s*br[^>]*>/gi,h=/<\s*hr[^>]*>/gi,d=/\/\s*>/g,o=t.match(l);if(o){let s=/xhtml/gi,c=/svg/gi;return o[0].match(s)||o[0].match(c)?"xhtml":"html"}let g=t.match(n)||[],u=t.match(r)||[],x=t.match(h)||[],i=g.concat(u).concat(x);if(i.length===0)return null;let p=0;for(let s=0,c=i.length;s<c;s++)e(i[s].match(d))&&(p+=1);return p>i.length/2?"xhtml":"html"}return j(M);})();
10
+ "use strict";var detectIsItHtmlOrXhtml=(()=>{var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var l in e)m(t,l,{get:e[l],enumerable:!0})},b=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!v.call(t,r)&&r!==l&&m(t,r,{get:()=>e[r],enumerable:!(n=y(e,r))||n.enumerable});return t};var j=t=>b(m({},"__esModule",{value:!0}),t);var M={};T(M,{detectIsItHTMLOrXhtml:()=>I,version:()=>w});var a="6.1.3";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 ".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));let l=/<\s*!\s*doctype[^>]*>/im,n=/<\s*img[^>]*>/gi,r=/<\s*br[^>]*>/gi,h=/<\s*hr[^>]*>/gi,d=/\/\s*>/g,o=t.match(l);if(o){let s=/xhtml/gi,c=/svg/gi;return o[0].match(s)||o[0].match(c)?"xhtml":"html"}let g=t.match(n)||[],u=t.match(r)||[],x=t.match(h)||[],i=g.concat(u).concat(x);if(i.length===0)return null;let p=0;for(let s=0,c=i.length;s<c;s++)e(i[s].match(d))&&(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.24",
3
+ "version": "6.1.3",
4
4
  "description": "Does the string resemble an HTML or XHTML (or neither)?",
5
5
  "keywords": [
6
6
  "check",
package/.eslintcache DELETED
@@ -1 +0,0 @@
1
- [{"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/doctype.js":"5","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/no-doctype.js":"6","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/test.js":"7","/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/undecided.js":"8"},{"size":299,"mtime":1760280945895,"results":"9","hashOfConfig":"10"},{"size":485,"mtime":1760280945895,"results":"11","hashOfConfig":"12"},{"size":373,"mtime":1760280945895,"results":"13","hashOfConfig":"10"},{"size":1854,"mtime":1760280945895,"results":"14","hashOfConfig":"12"},{"size":5513,"mtime":1760280945895,"results":"15","hashOfConfig":"16"},{"size":4206,"mtime":1760280945895,"results":"17","hashOfConfig":"16"},{"size":872,"mtime":1760280945895,"results":"18","hashOfConfig":"16"},{"size":1082,"mtime":1760280945895,"results":"19","hashOfConfig":"16"},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb",{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","suppressedMessages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","suppressedMessages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/doctype.js",[],["44","45","46","47","48","49"],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/no-doctype.js",[],["50","51","52","53","54","55"],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/test.js",[],["56","57","58","59","60","61"],"/home/runner/work/codsen/codsen/packages/detect-is-it-html-or-xhtml/test/undecided.js",[],["62","63","64","65","66"],{"ruleId":"67","severity":2,"message":"68","line":3,"column":17,"nodeType":null,"messageId":"69","endLine":3,"endColumn":19,"suppressions":"70"},{"ruleId":"67","severity":2,"message":"71","line":3,"column":21,"nodeType":null,"messageId":"69","endLine":3,"endColumn":23,"suppressions":"72"},{"ruleId":"67","severity":2,"message":"73","line":3,"column":25,"nodeType":null,"messageId":"69","endLine":3,"endColumn":31,"suppressions":"74"},{"ruleId":"67","severity":2,"message":"75","line":3,"column":33,"nodeType":null,"messageId":"69","endLine":3,"endColumn":37,"suppressions":"76"},{"ruleId":"67","severity":2,"message":"77","line":3,"column":39,"nodeType":null,"messageId":"69","endLine":3,"endColumn":42,"suppressions":"78"},{"ruleId":"67","severity":2,"message":"79","line":3,"column":44,"nodeType":null,"messageId":"69","endLine":3,"endColumn":49,"suppressions":"80"},{"ruleId":"67","severity":2,"message":"68","line":3,"column":17,"nodeType":null,"messageId":"69","endLine":3,"endColumn":19,"suppressions":"81"},{"ruleId":"67","severity":2,"message":"71","line":3,"column":21,"nodeType":null,"messageId":"69","endLine":3,"endColumn":23,"suppressions":"82"},{"ruleId":"67","severity":2,"message":"73","line":3,"column":25,"nodeType":null,"messageId":"69","endLine":3,"endColumn":31,"suppressions":"83"},{"ruleId":"67","severity":2,"message":"75","line":3,"column":33,"nodeType":null,"messageId":"69","endLine":3,"endColumn":37,"suppressions":"84"},{"ruleId":"67","severity":2,"message":"77","line":3,"column":39,"nodeType":null,"messageId":"69","endLine":3,"endColumn":42,"suppressions":"85"},{"ruleId":"67","severity":2,"message":"79","line":3,"column":44,"nodeType":null,"messageId":"69","endLine":3,"endColumn":49,"suppressions":"86"},{"ruleId":"67","severity":2,"message":"68","line":3,"column":17,"nodeType":null,"messageId":"69","endLine":3,"endColumn":19,"suppressions":"87"},{"ruleId":"67","severity":2,"message":"71","line":3,"column":21,"nodeType":null,"messageId":"69","endLine":3,"endColumn":23,"suppressions":"88"},{"ruleId":"67","severity":2,"message":"73","line":3,"column":25,"nodeType":null,"messageId":"69","endLine":3,"endColumn":31,"suppressions":"89"},{"ruleId":"67","severity":2,"message":"75","line":3,"column":33,"nodeType":null,"messageId":"69","endLine":3,"endColumn":37,"suppressions":"90"},{"ruleId":"67","severity":2,"message":"77","line":3,"column":39,"nodeType":null,"messageId":"69","endLine":3,"endColumn":42,"suppressions":"91"},{"ruleId":"67","severity":2,"message":"79","line":3,"column":44,"nodeType":null,"messageId":"69","endLine":3,"endColumn":49,"suppressions":"92"},{"ruleId":"67","severity":2,"message":"68","line":3,"column":17,"nodeType":null,"messageId":"69","endLine":3,"endColumn":19,"suppressions":"93"},{"ruleId":"67","severity":2,"message":"71","line":3,"column":21,"nodeType":null,"messageId":"69","endLine":3,"endColumn":23,"suppressions":"94"},{"ruleId":"67","severity":2,"message":"75","line":3,"column":33,"nodeType":null,"messageId":"69","endLine":3,"endColumn":37,"suppressions":"95"},{"ruleId":"67","severity":2,"message":"77","line":3,"column":39,"nodeType":null,"messageId":"69","endLine":3,"endColumn":42,"suppressions":"96"},{"ruleId":"67","severity":2,"message":"79","line":3,"column":44,"nodeType":null,"messageId":"69","endLine":3,"endColumn":49,"suppressions":"97"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["98"],"'ok' is defined but never used.",["99"],"'throws' is defined but never used.",["100"],"'type' is defined but never used.",["101"],"'not' is defined but never used.",["102"],"'match' is defined but never used.",["103"],["104"],["105"],["106"],["107"],["108"],["109"],["110"],["111"],["112"],["113"],["114"],["115"],["116"],["117"],["118"],["119"],["120"],{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},{"kind":"121","justification":"122"},"directive",""]