detect-templating-language 4.0.12 → 4.0.22
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.
|
@@ -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.
|
|
4
|
+
* @version 4.0.22
|
|
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="4.0.
|
|
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.22";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};
|
|
@@ -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.
|
|
4
|
+
* @version 4.0.22
|
|
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 i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var
|
|
10
|
+
"use strict";var detectTemplatingLanguage=(()=>{var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},d=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l(t))!g.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=c(t,n))||r.enumerable});return e};var f=e=>d(i({},"__esModule",{value:!0}),e);var y={};m(y,{detectLang:()=>x,version:()=>v});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.22";var v=a;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 ".concat(JSON.stringify(e,null,4)," (type ").concat(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.
|
|
14
|
+
* @version 4.0.18
|
|
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.
|
|
22
|
+
* @version 4.0.18
|
|
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.
|
|
30
|
+
* @version 4.0.18
|
|
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.
|
|
3
|
+
"version": "4.0.22",
|
|
4
4
|
"description": "Detects various templating languages present in string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"check",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
|
|
39
39
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
40
40
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
41
|
-
"letspublish": "npm publish || :",
|
|
41
|
+
"letspublish": "npm publish --provenance || :",
|
|
42
42
|
"lint": "eslint . --fix",
|
|
43
43
|
"perf": "node perf/check.js",
|
|
44
44
|
"prep": "echo 'ready'",
|
|
@@ -66,8 +66,11 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"regex-is-jinja-nunjucks": "^4.0.
|
|
70
|
-
"regex-is-jsp": "^4.0.
|
|
71
|
-
"regex-jinja-specific": "^4.0.
|
|
69
|
+
"regex-is-jinja-nunjucks": "^4.0.18",
|
|
70
|
+
"regex-is-jsp": "^4.0.18",
|
|
71
|
+
"regex-jinja-specific": "^4.0.18"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"registry": "https://registry.npmjs.org/"
|
|
72
75
|
}
|
|
73
76
|
}
|
package/types/index.d.ts
CHANGED