slicejs-cli 1.0.26 → 1.0.29

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.
@@ -89,27 +89,22 @@ function addGetterSetterIfNeeded(componentContent, property) {
89
89
  }
90
90
 
91
91
  function removePropertyIfNeeded(componentContent, property) {
92
- let updatedComponentContent = componentContent;
93
-
94
- // Verificar si la propiedad está en debuggerProps
95
- const propIndex = componentContent.indexOf(`'${property}'`);
96
- if (propIndex !== -1) {
97
- // Eliminar la propiedad de debuggerProps
98
- const startIndex = componentContent.lastIndexOf('[', propIndex);
99
- const endIndex = componentContent.indexOf(']', propIndex);
100
- updatedComponentContent = componentContent.slice(0, startIndex) + componentContent.slice(endIndex + 1);
101
- console.log(`Property '${property}' removed from debuggerProps.`);
92
+ // Eliminar la propiedad de debuggerProps si está presente
93
+ const propRegex = /this\.debuggerProps\s*=\s*\[(.*?)\];/s;
94
+ const match = componentContent.match(propRegex);
95
+ if (match && match[1]) {
96
+ let props = match[1].split(',').map(prop => prop.trim().replace(/['"]/g, ''));
97
+ const propIndex = props.indexOf(property);
98
+ if (propIndex !== -1) {
99
+ props.splice(propIndex, 1);
100
+ componentContent = componentContent.replace(propRegex, `this.debuggerProps = [${props.map(prop => `'${prop}'`).join(', ')}];`);
101
+ }
102
102
  }
103
103
 
104
- // Verificar si la propiedad tiene getters y setters
105
- const hasGetterSetter = hasGetterSetterForProperty(componentContent, property);
106
- if (hasGetterSetter) {
107
- // Eliminar los getters y setters del componente
108
- updatedComponentContent = removeGetterSetter(updatedComponentContent, property);
109
- console.log(`Getters and setters removed for property '${property}'.`);
110
- }
104
+ // Eliminar los getters y setters de la propiedad
105
+ componentContent = removeGetterSetter(componentContent, property);
111
106
 
112
- return updatedComponentContent;
107
+ return componentContent;
113
108
  }
114
109
 
115
110
  function hasGetterSetterForProperty(componentContent, property) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "1.0.26",
3
+ "version": "1.0.29",
4
4
  "description": "Command client for developing web applications with Slice.js",
5
5
  "main": "client.js",
6
6
  "scripts": {