detect-templating-language 3.0.11 → 3.0.14

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/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## Install
28
28
 
29
- The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
29
+ This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 2.1.0 (`npm i detect-templating-language@2.1.0`).
30
30
 
31
31
  ```bash
32
32
  npm i detect-templating-language
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name detect-templating-language
3
3
  * @fileoverview Detects various templating languages present in string
4
- * @version 3.0.11
4
+ * @version 3.0.14
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 i}from"regex-is-jinja-nunjucks";import{isJSP as r}from"regex-is-jsp";import{isJinjaSpecific as p}from"regex-jinja-specific";var n="3.0.11";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?(i().test(e)?(t="Nunjucks",p().test(e)&&(t="Jinja")):r().test(e)&&(t="JSP"),{name:t}):{name:t}}export{g as detectLang,d as version};
10
+ import{isJinjaNunjucksRegex as s}from"regex-is-jinja-nunjucks";import{isJSP as i}from"regex-is-jsp";import{isJinjaSpecific as p}from"regex-jinja-specific";var n="3.0.14";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?(s().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,17 +1,17 @@
1
1
  /**
2
2
  * @name detect-templating-language
3
3
  * @fileoverview Detects various templating languages present in string
4
- * @version 3.0.11
4
+ * @version 3.0.14
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
- var detectTemplatingLanguage=(()=>{var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=e=>i(e,"__esModule",{value:!0});var m=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of l(t))!d.call(e,s)&&(n||s!=="default")&&i(e,s,{get:()=>t[s],enumerable:!(r=o(t,s))||r.enumerable});return e};var y=(e=>(t,n)=>e&&e.get(t)||(n=f(g({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var h={};m(h,{detectLang:()=>v,version:()=>x});function a(){return/{%|{{|%}|}}/gi}function p(){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 c="3.0.11";var x=c;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?(a().test(e)?(t="Nunjucks",u().test(e)&&(t="Jinja")):p().test(e)&&(t="JSP"),{name:t}):{name:t}}return y(h);})();
10
+ 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 x={};g(x,{detectLang:()=>v,version:()=>j});function a(){return/{%|{{|%}|}}/gi}function p(){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 o="3.0.14";var j=o;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?(a().test(e)?(t="Nunjucks",u().test(e)&&(t="Jinja")):p().test(e)&&(t="JSP"),{name:t}):{name:t}}return y(x);})();
11
11
  /**
12
12
  * @name regex-is-jinja-nunjucks
13
13
  * @fileoverview Regular expression for detecting Jinja or Nunjucks code
14
- * @version 3.0.11
14
+ * @version 3.0.13
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 @@ var detectTemplatingLanguage=(()=>{var i=Object.defineProperty;var o=Object.getO
19
19
  /**
20
20
  * @name regex-is-jsp
21
21
  * @fileoverview Regular expression for detecting JSP (Java Server Pages) code
22
- * @version 3.0.11
22
+ * @version 3.0.14
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 @@ var detectTemplatingLanguage=(()=>{var i=Object.defineProperty;var o=Object.getO
27
27
  /**
28
28
  * @name regex-jinja-specific
29
29
  * @fileoverview Regular expression for detecting Python-specific Jinja code
30
- * @version 3.0.11
30
+ * @version 3.0.13
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": "3.0.11",
3
+ "version": "3.0.14",
4
4
  "description": "Detects various templating languages present in string",
5
5
  "keywords": [
6
6
  "check",
@@ -31,9 +31,10 @@
31
31
  "scripts": {
32
32
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
33
33
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
34
+ "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
34
35
  "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
35
36
  "examples": "node '../../ops/scripts/run-examples.js'",
36
- "lect": "node '../../ops/lect/lect.js'",
37
+ "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
37
38
  "letspublish": "yarn publish || :",
38
39
  "lint": "eslint . --fix",
39
40
  "perf": "node perf/check.js",
@@ -41,7 +42,7 @@
41
42
  "prettier": "prettier",
42
43
  "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
43
44
  "pretest": "yarn run lect && yarn run build",
44
- "test": "c8 yarn run unit && yarn run examples && yarn run lint",
45
+ "test": "yarn run devtest",
45
46
  "unit": "uvu test"
46
47
  },
47
48
  "engines": {
@@ -62,8 +63,8 @@
62
63
  }
63
64
  },
64
65
  "dependencies": {
65
- "regex-is-jinja-nunjucks": "^3.0.11",
66
- "regex-is-jsp": "^3.0.11",
67
- "regex-jinja-specific": "^3.0.11"
66
+ "regex-is-jinja-nunjucks": "^3.0.13",
67
+ "regex-is-jsp": "^3.0.14",
68
+ "regex-jinja-specific": "^3.0.13"
68
69
  }
69
70
  }