slicejs-cli 1.0.27 → 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,23 +89,22 @@ function addGetterSetterIfNeeded(componentContent, property) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function removePropertyIfNeeded(componentContent, property) {
|
|
92
|
-
let updatedComponentContent = componentContent;
|
|
93
|
-
|
|
94
92
|
// Eliminar la propiedad de debuggerProps si está presente
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
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, ''));
|
|
98
97
|
const propIndex = props.indexOf(property);
|
|
99
98
|
if (propIndex !== -1) {
|
|
100
99
|
props.splice(propIndex, 1);
|
|
100
|
+
componentContent = componentContent.replace(propRegex, `this.debuggerProps = [${props.map(prop => `'${prop}'`).join(', ')}];`);
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
});
|
|
102
|
+
}
|
|
104
103
|
|
|
105
104
|
// Eliminar los getters y setters de la propiedad
|
|
106
|
-
|
|
105
|
+
componentContent = removeGetterSetter(componentContent, property);
|
|
107
106
|
|
|
108
|
-
return
|
|
107
|
+
return componentContent;
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
function hasGetterSetterForProperty(componentContent, property) {
|