detect-is-it-html-or-xhtml 6.0.0 → 6.0.2

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,27 +3,27 @@
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.0.0 (2022-12-01)
6
+ ## [6.0.2](https://github.com/codsen/codsen/compare/detect-is-it-html-or-xhtml@6.0.1...detect-is-it-html-or-xhtml@6.0.2) (2022-12-06)
7
7
 
8
- ### Bug Fixes
8
+ **Note:** Version bump only for package detect-is-it-html-or-xhtml
9
9
 
10
- - tweak types ([96755ff](https://github.com/codsen/codsen/commit/96755ff0f516243785080a184f83fd6efc14c6b6))
10
+ ## 6.0.0 (2022-12-01)
11
11
 
12
- ### Features
12
+ ### Bug Fixes
13
13
 
14
- - drop Node v12 support; minimum version requirement now is v14.18 and above ([c8049e8](https://github.com/codsen/codsen/commit/c8049e82a5844d3f72587740f1cc74e3c9020d22))
14
+ - tweak types ([96755ff](https://github.com/codsen/codsen/commit/96755ff0f516243785080a184f83fd6efc14c6b6))
15
15
 
16
16
  ### BREAKING CHANGES
17
17
 
18
18
  - Minimum supported Node version is v14.18; we're dropping v12 support
19
19
 
20
- # 5.1.0 (2022-08-12)
20
+ ## 5.1.0 (2022-08-12)
21
21
 
22
22
  ### Features
23
23
 
24
24
  - export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
25
25
 
26
- ## [5.0.14](https://github.com/codsen/codsen/compare/detect-is-it-html-or-xhtml@5.0.13...detect-is-it-html-or-xhtml@5.0.14) (2022-04-21)
26
+ ## 5.0.14 (2022-04-21)
27
27
 
28
28
  ### Fixed
29
29
 
@@ -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.0
4
+ * @version 6.0.2
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.0";var T=i;function b(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,a=/<\s*img[^>]*>/gi,m=/<\s*br[^>]*>/gi,d=/<\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 p=t.match(a)||[],u=t.match(m)||[],g=t.match(d)||[],r=p.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(h))&&(n+=1);return n>r.length/2?"xhtml":"html"}export{b as detectIsItHTMLOrXhtml,T as version};
10
+ var i="6.0.2";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.0
4
+ * @version 6.0.2
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 a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var l in e)a(t,l,{get:e[l],enumerable:!0})},v=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!T.call(t,r)&&r!==l&&a(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var j=t=>v(a({},"__esModule",{value:!0}),t);var M={};b(M,{detectIsItHTMLOrXhtml:()=>I,version:()=>w});var d="6.0.0";var w=d;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,h=/<\s*hr[^>]*>/gi,p=/\/\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 u=t.match(n)||[],g=t.match(r)||[],y=t.match(h)||[],i=u.concat(g).concat(y);if(i.length===0)return null;let m=0;for(let s=0,c=i.length;s<c;s++)e(i[s].match(p))&&(m+=1);return m>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.2";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.0",
3
+ "version": "6.0.2",
4
4
  "description": "Does the string resemble an HTML or XHTML (or neither)?",
5
5
  "keywords": [
6
6
  "check",
@@ -38,22 +38,22 @@
38
38
  },
39
39
  "types": "types/index.d.ts",
40
40
  "scripts": {
41
- "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
41
+ "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
42
42
  "cjs-off": "exit 0",
43
43
  "cjs-on": "exit 0",
44
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
45
- "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
46
- "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
44
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
45
+ "devtest": "c8 npm run unit && npm run examples && npm run lint",
46
+ "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
47
47
  "examples": "node '../../ops/scripts/run-examples.js'",
48
- "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
49
- "letspublish": "yarn publish || :",
48
+ "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
49
+ "letspublish": "npm publish || :",
50
50
  "lint": "eslint . --ext .js --ext .ts --fix",
51
51
  "perf": "node perf/check.js",
52
- "prepare": "echo 'ready'",
52
+ "prep": "echo 'ready'",
53
53
  "prettier": "prettier",
54
- "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
55
- "pretest": "yarn run lect && yarn run build",
56
- "test": "yarn run devtest",
54
+ "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
55
+ "pretest": "npm run lect && npm run build",
56
+ "test": "npm run devtest",
57
57
  "unit": "uvu test"
58
58
  },
59
59
  "engines": {
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare const version: string;
2
- declare type Output = "html" | "xhtml" | null;
2
+ type Output = "html" | "xhtml" | null;
3
3
  declare function detectIsItHTMLOrXhtml(input: string): Output;
4
4
 
5
5
  export { Output, detectIsItHTMLOrXhtml, version };