jcc-express-mvc 1.1.0 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcc-express-mvc",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "express mvc structure",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@ class Template {
5
5
  #directives = {
6
6
  extends: /@extends\((?<extendPath>['"]([^'"]+)['"])\)/,
7
7
  foreach:
8
- /@foreach\s*\((?<loopvariable>(.*?)+) in (?<loopData>(.*?)+)\)(?<loopBody>[\s\S\t\n\r]+?)@endforeach/,
8
+ /@foreach\s*\((?<loopData>(.*?)+) as (?<loopvariable>(.*?)+)\)(?<loopBody>[\s\S\t\n\r]+?)@endforeach/,
9
9
  if: /@if\s*\((?<ifData>(.*?))\)\s*(?<ifBody>[\s\S]*?)\s*(?:@else\s*(?<elseBody>[\s\S]*?)\s*)?@endif/g,
10
10
  include: /@include\((?<includePath>['"]([^'"]+)['"])\)/,
11
11
  ternary:
@@ -110,7 +110,8 @@ class Template {
110
110
  const authData = match?.groups?.authData?.replace(/(\'|\")/g, "");
111
111
  if (
112
112
  (authData && param?.Auth?.role === authData) ||
113
- param?.Auth?.roleType === authData
113
+ param?.Auth?.roleType === authData ||
114
+ param?.Auth?.isAdmin
114
115
  ) {
115
116
  result = match?.groups?.authBody;
116
117
  }