detect-templating-language 4.0.9 → 4.0.12
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/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2025 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -61,6 +61,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
61
61
|
|
|
62
62
|
MIT License.
|
|
63
63
|
|
|
64
|
-
Copyright © 2010-
|
|
64
|
+
Copyright © 2010-2025 Roy Revelt and other contributors.
|
|
65
65
|
|
|
66
66
|
<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
|
|
@@ -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.12
|
|
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.12";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.
|
|
4
|
+
* @version 4.0.12
|
|
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 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.
|
|
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.12";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.
|
|
14
|
+
* @version 4.0.9
|
|
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.9
|
|
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.9
|
|
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.12",
|
|
4
4
|
"description": "Detects various templating languages present in string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"check",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"homepage": "https://codsen.com/os/detect-templating-language",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/codsen/codsen.git",
|
|
16
|
+
"url": "git+https://github.com/codsen/codsen.git",
|
|
17
17
|
"directory": "packages/detect-templating-language"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
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
41
|
"letspublish": "npm publish || :",
|
|
42
|
-
"lint": "eslint . --
|
|
42
|
+
"lint": "eslint . --fix",
|
|
43
43
|
"perf": "node perf/check.js",
|
|
44
44
|
"prep": "echo 'ready'",
|
|
45
45
|
"prettier": "prettier",
|
|
@@ -66,8 +66,8 @@
|
|
|
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.9",
|
|
70
|
+
"regex-is-jsp": "^4.0.9",
|
|
71
|
+
"regex-jinja-specific": "^4.0.9"
|
|
72
72
|
}
|
|
73
73
|
}
|