@currentjs/gen 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.1.2] - 2025-09-18
6
+
7
+ fix: failed to generate with empty permissions actions
8
+
4
9
  ## [0.1.1] - 2025-09-17
5
10
 
6
11
  Initial release
@@ -57,8 +57,8 @@ class ControllerGenerator {
57
57
  Object.keys(moduleConfig.actions).forEach(action => {
58
58
  actionPermissions[action] = [];
59
59
  });
60
- moduleConfig.permissions.forEach(permission => {
61
- permission.actions.forEach(action => {
60
+ (moduleConfig.permissions || []).forEach(permission => {
61
+ (permission.actions || []).forEach(action => {
62
62
  if (actionPermissions[action]) {
63
63
  actionPermissions[action].push(permission.role);
64
64
  }
@@ -59,8 +59,8 @@ class ServiceGenerator {
59
59
  actionPermissions[action] = [];
60
60
  });
61
61
  // Fill in permissions for each action
62
- moduleConfig.permissions.forEach(permission => {
63
- permission.actions.forEach(action => {
62
+ (moduleConfig.permissions || []).forEach(permission => {
63
+ (permission.actions || []).forEach(action => {
64
64
  if (actionPermissions[action]) {
65
65
  actionPermissions[action].push(permission.role);
66
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@currentjs/gen",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI code generator",
5
5
  "license": "LGPL-3.0",
6
6
  "author": "Konstantin Zavalny",