detect-templating-language 3.1.5 → 4.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,7 +3,13 @@
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
- # 3.1.0 (2022-08-12)
6
+ ## 4.0.0 (2022-12-01)
7
+
8
+ ### BREAKING CHANGES
9
+
10
+ - Minimum supported Node version is v14.18; we're dropping v12 support
11
+
12
+ ## 3.1.0 (2022-08-12)
7
13
 
8
14
  ### Features
9
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detect-templating-language",
3
- "version": "3.1.5",
3
+ "version": "4.0.1",
4
4
  "description": "Detects various templating languages present in string",
5
5
  "keywords": [
6
6
  "check",
@@ -30,26 +30,26 @@
30
30
  },
31
31
  "types": "types/index.d.ts",
32
32
  "scripts": {
33
- "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
33
+ "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
34
34
  "cjs-off": "exit 0",
35
35
  "cjs-on": "exit 0",
36
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
37
- "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
38
- "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
36
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
37
+ "devtest": "c8 npm run unit && npm run examples && npm run lint",
38
+ "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
39
39
  "examples": "node '../../ops/scripts/run-examples.js'",
40
- "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
41
- "letspublish": "yarn publish || :",
40
+ "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
41
+ "letspublish": "npm publish || :",
42
42
  "lint": "eslint . --ext .js --ext .ts --fix",
43
43
  "perf": "node perf/check.js",
44
- "prepare": "echo 'ready'",
44
+ "prep": "echo 'ready'",
45
45
  "prettier": "prettier",
46
- "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
47
- "pretest": "yarn run lect && yarn run build",
48
- "test": "yarn run devtest",
46
+ "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
47
+ "pretest": "npm run lect && npm run build",
48
+ "test": "npm run devtest",
49
49
  "unit": "uvu test"
50
50
  },
51
51
  "engines": {
52
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
52
+ "node": ">=14.18.0"
53
53
  },
54
54
  "c8": {
55
55
  "check-coverage": true,
@@ -66,8 +66,8 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "regex-is-jinja-nunjucks": "^3.1.5",
70
- "regex-is-jsp": "^3.1.5",
71
- "regex-jinja-specific": "^3.1.5"
69
+ "regex-is-jinja-nunjucks": "^4.0.1",
70
+ "regex-is-jsp": "^4.0.1",
71
+ "regex-jinja-specific": "^4.0.1"
72
72
  }
73
73
  }
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare const version: string;
2
- declare type Output = "Nunjucks" | "Jinja" | "JSP" | null;
2
+ type Output = "Nunjucks" | "Jinja" | "JSP" | null;
3
3
  declare function detectLang(str: string): {
4
4
  name: Output;
5
5
  };
@@ -1,10 +0,0 @@
1
- /**
2
- * @name detect-templating-language
3
- * @fileoverview Detects various templating languages present in string
4
- * @version 3.1.5
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/detect-templating-language/}
8
- */
9
-
10
- import{isJinjaNunjucksRegex as r}from"regex-is-jinja-nunjucks";import{isJSP as i}from"regex-is-jsp";import{isJinjaSpecific as p}from"regex-jinja-specific";var n="3.1.5";var d=n;function g(e){let t=null;if(typeof e!="string")throw new TypeError(`detect-templating-language: [THROW_ID_01] Input must be string! It was given as ${JSON.stringify(e,null,4)} (type ${typeof e}).`);return e?(r().test(e)?(t="Nunjucks",p().test(e)&&(t="Jinja")):i().test(e)&&(t="JSP"),{name:t}):{name:t}}export{g as detectLang,d as version};
@@ -1,34 +0,0 @@
1
- /**
2
- * @name detect-templating-language
3
- * @fileoverview Detects various templating languages present in string
4
- * @version 3.1.5
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/detect-templating-language/}
8
- */
9
-
10
- "use strict";var detectTemplatingLanguage=(()=>{var r=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var s in t)r(e,s,{get:t[s],enumerable:!0})},m=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l(t))!d.call(e,n)&&n!==s&&r(e,n,{get:()=>t[n],enumerable:!(i=c(t,n))||i.enumerable});return e};var y=e=>m(r({},"__esModule",{value:!0}),e);var v={};g(v,{detectLang:()=>x,version:()=>j});function a(){return/{%|{{|%}|}}/gi}function p(){return/<%|%>|<\s*jsp:|<\s*cms:|<\s*c:|\${\s*jsp/gi}function o(){return/(set\s*[\w]+\s*=\s*namespace\()|({{['"][\w]+['"]\s+if)|(['"]%x?[+0]?[.>^<]?\d+[\w%]['"]\|format\()/gi}var u="3.1.5";var j=u;function x(e){let t=null;if(typeof e!="string")throw new TypeError(`detect-templating-language: [THROW_ID_01] Input must be string! It was given as ${JSON.stringify(e,null,4)} (type ${typeof e}).`);return e?(a().test(e)?(t="Nunjucks",o().test(e)&&(t="Jinja")):p().test(e)&&(t="JSP"),{name:t}):{name:t}}return y(v);})();
11
- /**
12
- * @name regex-is-jinja-nunjucks
13
- * @fileoverview Regular expression for detecting Jinja or Nunjucks code
14
- * @version 3.1.5
15
- * @author Roy Revelt, Codsen Ltd
16
- * @license MIT
17
- * {@link https://codsen.com/os/regex-is-jinja-nunjucks/}
18
- */
19
- /**
20
- * @name regex-is-jsp
21
- * @fileoverview Regular expression for detecting JSP (Java Server Pages) code
22
- * @version 3.1.5
23
- * @author Roy Revelt, Codsen Ltd
24
- * @license MIT
25
- * {@link https://codsen.com/os/regex-is-jsp/}
26
- */
27
- /**
28
- * @name regex-jinja-specific
29
- * @fileoverview Regular expression for detecting Python-specific Jinja code
30
- * @version 3.1.5
31
- * @author Roy Revelt, Codsen Ltd
32
- * @license MIT
33
- * {@link https://codsen.com/os/regex-jinja-specific/}
34
- */