detect-templating-language 3.0.13 → 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.
|
@@ -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.
|
|
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 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.
|
|
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,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name detect-templating-language
|
|
3
3
|
* @fileoverview Detects various templating languages present in string
|
|
4
|
-
* @version 3.0.
|
|
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 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.
|
|
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
|
|
@@ -19,7 +19,7 @@ var detectTemplatingLanguage=(()=>{var r=Object.defineProperty;var c=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.
|
|
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/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "detect-templating-language",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.14",
|
|
4
4
|
"description": "Detects various templating languages present in string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"check",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"regex-is-jinja-nunjucks": "^3.0.13",
|
|
67
|
-
"regex-is-jsp": "^3.0.
|
|
67
|
+
"regex-is-jsp": "^3.0.14",
|
|
68
68
|
"regex-jinja-specific": "^3.0.13"
|
|
69
69
|
}
|
|
70
70
|
}
|