detect-is-it-html-or-xhtml 5.1.6 → 6.0.1

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,13 +3,23 @@
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
- # 5.1.0 (2022-08-12)
6
+ ## 6.0.0 (2022-12-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - tweak types ([96755ff](https://github.com/codsen/codsen/commit/96755ff0f516243785080a184f83fd6efc14c6b6))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ - Minimum supported Node version is v14.18; we're dropping v12 support
15
+
16
+ ## 5.1.0 (2022-08-12)
7
17
 
8
18
  ### Features
9
19
 
10
20
  - export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
11
21
 
12
- ## [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)
22
+ ## 5.0.14 (2022-04-21)
13
23
 
14
24
  ### Fixed
15
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detect-is-it-html-or-xhtml",
3
- "version": "5.1.6",
3
+ "version": "6.0.1",
4
4
  "description": "Does the string resemble an HTML or XHTML (or neither)?",
5
5
  "keywords": [
6
6
  "check",
@@ -38,26 +38,26 @@
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": {
60
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
60
+ "node": ">=14.18.0"
61
61
  },
62
62
  "c8": {
63
63
  "check-coverage": true,
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 };
@@ -1,10 +0,0 @@
1
- /**
2
- * @name detect-is-it-html-or-xhtml
3
- * @fileoverview Does the string resemble an HTML or XHTML (or neither)?
4
- * @version 5.1.6
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/detect-is-it-html-or-xhtml/}
8
- */
9
-
10
- var i="5.1.6";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};
@@ -1,10 +0,0 @@
1
- /**
2
- * @name detect-is-it-html-or-xhtml
3
- * @fileoverview Does the string resemble an HTML or XHTML (or neither)?
4
- * @version 5.1.6
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/detect-is-it-html-or-xhtml/}
8
- */
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="5.1.6";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);})();