detect-is-it-html-or-xhtml 6.0.23 → 6.1.0

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/.eslintcache ADDED
@@ -0,0 +1 @@
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":1760566739083,"results":"9","hashOfConfig":"10"},{"size":485,"mtime":1760566739083,"results":"11","hashOfConfig":"12"},{"size":373,"mtime":1760566739083,"results":"13","hashOfConfig":"10"},{"size":1854,"mtime":1760566739083,"results":"14","hashOfConfig":"12"},{"size":5513,"mtime":1760566739083,"results":"15","hashOfConfig":"16"},{"size":4206,"mtime":1760566739083,"results":"17","hashOfConfig":"16"},{"size":872,"mtime":1760566739083,"results":"18","hashOfConfig":"16"},{"size":1082,"mtime":1760566739083,"results":"19","hashOfConfig":"16"},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"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},"nrihsz",{"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",""]
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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2025 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
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
 
@@ -54,8 +54,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
54
54
 
55
55
  ## Licence
56
56
 
57
- MIT License.
57
+ MIT License
58
58
 
59
- Copyright © 2010-2025 Roy Revelt and other contributors.
59
+ Copyright © 2010-2025 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.23
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 6.1.0
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.23";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,h=/\/\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 d=t.match(c)||[],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.0";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.23
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 6.1.0
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 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.23";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,m=/svg/gi;return o[0].match(s)||o[0].match(m)?"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,m=i.length;s<m;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.0";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.23",
3
+ "version": "6.1.0",
4
4
  "description": "Does the string resemble an HTML or XHTML (or neither)?",
5
5
  "keywords": [
6
6
  "check",
@@ -47,7 +47,7 @@
47
47
  "examples": "node '../../ops/scripts/run-examples.js'",
48
48
  "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
49
49
  "letspublish": "npm publish --provenance || :",
50
- "lint": "eslint . --fix",
50
+ "lint": "eslint . --fix --concurrency=auto --cache",
51
51
  "perf": "node perf/check.js",
52
52
  "prep": "echo 'ready'",
53
53
  "prettier": "prettier",