detect-templating-language 4.0.0 → 4.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,17 +3,17 @@
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
- # 4.0.0 (2022-12-01)
6
+ ## [4.0.2](https://github.com/codsen/codsen/compare/detect-templating-language@4.0.1...detect-templating-language@4.0.2) (2022-12-06)
7
7
 
8
- ### Features
8
+ **Note:** Version bump only for package detect-templating-language
9
9
 
10
- - drop Node v12 support; minimum version requirement now is v14.18 and above ([c8049e8](https://github.com/codsen/codsen/commit/c8049e82a5844d3f72587740f1cc74e3c9020d22))
10
+ ## 4.0.0 (2022-12-01)
11
11
 
12
12
  ### BREAKING CHANGES
13
13
 
14
14
  - Minimum supported Node version is v14.18; we're dropping v12 support
15
15
 
16
- # 3.1.0 (2022-08-12)
16
+ ## 3.1.0 (2022-08-12)
17
17
 
18
18
  ### Features
19
19
 
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name detect-templating-language
3
3
  * @fileoverview Detects various templating languages present in string
4
- * @version 4.0.0
4
+ * @version 4.0.2
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/detect-templating-language/}
8
8
  */
9
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="4.0.0";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};
10
+ import{isJinjaNunjucksRegex as i}from"regex-is-jinja-nunjucks";import{isJSP as r}from"regex-is-jsp";import{isJinjaSpecific as p}from"regex-jinja-specific";var n="4.0.2";var d=n;function m(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?(i().test(e)?(t="Nunjucks",p().test(e)&&(t="Jinja")):r().test(e)&&(t="JSP"),{name:t}):{name:t}}export{m as detectLang,d as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name detect-templating-language
3
3
  * @fileoverview Detects various templating languages present in string
4
- * @version 4.0.0
4
+ * @version 4.0.2
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/detect-templating-language/}
8
8
  */
9
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="4.0.0";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);})();
10
+ "use strict";var detectTemplatingLanguage=(()=>{var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l(t))!m.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=c(t,n))||r.enumerable});return e};var f=e=>g(i({},"__esModule",{value:!0}),e);var y={};d(y,{detectLang:()=>v,version:()=>x});function p(){return/{%|{{|%}|}}/gi}function o(){return/<%|%>|<\s*jsp:|<\s*cms:|<\s*c:|\${\s*jsp/gi}function u(){return/(set\s*[\w]+\s*=\s*namespace\()|({{['"][\w]+['"]\s+if)|(['"]%x?[+0]?[.>^<]?\d+[\w%]['"]\|format\()/gi}var a="4.0.2";var x=a;function v(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?(p().test(e)?(t="Nunjucks",u().test(e)&&(t="Jinja")):o().test(e)&&(t="JSP"),{name:t}):{name:t}}return f(y);})();
11
11
  /**
12
12
  * @name regex-is-jinja-nunjucks
13
13
  * @fileoverview Regular expression for detecting Jinja or Nunjucks code
14
- * @version 4.0.0
14
+ * @version 4.0.2
15
15
  * @author Roy Revelt, Codsen Ltd
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/regex-is-jinja-nunjucks/}
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * @name regex-is-jsp
21
21
  * @fileoverview Regular expression for detecting JSP (Java Server Pages) code
22
- * @version 4.0.0
22
+ * @version 4.0.2
23
23
  * @author Roy Revelt, Codsen Ltd
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/regex-is-jsp/}
@@ -27,7 +27,7 @@
27
27
  /**
28
28
  * @name regex-jinja-specific
29
29
  * @fileoverview Regular expression for detecting Python-specific Jinja code
30
- * @version 4.0.0
30
+ * @version 4.0.2
31
31
  * @author Roy Revelt, Codsen Ltd
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/regex-jinja-specific/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detect-templating-language",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Detects various templating languages present in string",
5
5
  "keywords": [
6
6
  "check",
@@ -30,22 +30,22 @@
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": {
@@ -66,8 +66,8 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "regex-is-jinja-nunjucks": "^4.0.0",
70
- "regex-is-jsp": "^4.0.0",
71
- "regex-jinja-specific": "^4.0.0"
69
+ "regex-is-jinja-nunjucks": "^4.0.2",
70
+ "regex-is-jsp": "^4.0.2",
71
+ "regex-jinja-specific": "^4.0.2"
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
  };