@stencil/angular-output-target 0.8.3 → 0.8.4
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/dist/generate-angular-component.js +16 -1
- package/dist/index.cjs.js +16 -1
- package/dist/index.js +16 -1
- package/package.json +1 -1
|
@@ -81,7 +81,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
81
81
|
.reduce((type, [src, dst]) => {
|
|
82
82
|
let renamedType = type;
|
|
83
83
|
if (!type.startsWith(prefix)) {
|
|
84
|
-
|
|
84
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
85
|
+
/**
|
|
86
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
87
|
+
* For example, `{ a: string }`.
|
|
88
|
+
* We don't need to rename these types, so we return the original type.
|
|
89
|
+
*/
|
|
90
|
+
renamedType = type;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
/**
|
|
94
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
95
|
+
* For example, `MyType`.
|
|
96
|
+
* We need to rename these types, so we prepend the prefix.
|
|
97
|
+
*/
|
|
98
|
+
renamedType = `I${componentClassName}${type}`;
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
return (renamedType
|
|
87
102
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
package/dist/index.cjs.js
CHANGED
|
@@ -226,7 +226,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
226
226
|
.reduce((type, [src, dst]) => {
|
|
227
227
|
let renamedType = type;
|
|
228
228
|
if (!type.startsWith(prefix)) {
|
|
229
|
-
|
|
229
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
230
|
+
/**
|
|
231
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
232
|
+
* For example, `{ a: string }`.
|
|
233
|
+
* We don't need to rename these types, so we return the original type.
|
|
234
|
+
*/
|
|
235
|
+
renamedType = type;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
/**
|
|
239
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
240
|
+
* For example, `MyType`.
|
|
241
|
+
* We need to rename these types, so we prepend the prefix.
|
|
242
|
+
*/
|
|
243
|
+
renamedType = `I${componentClassName}${type}`;
|
|
244
|
+
}
|
|
230
245
|
}
|
|
231
246
|
return (renamedType
|
|
232
247
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
package/dist/index.js
CHANGED
|
@@ -218,7 +218,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
218
218
|
.reduce((type, [src, dst]) => {
|
|
219
219
|
let renamedType = type;
|
|
220
220
|
if (!type.startsWith(prefix)) {
|
|
221
|
-
|
|
221
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
222
|
+
/**
|
|
223
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
224
|
+
* For example, `{ a: string }`.
|
|
225
|
+
* We don't need to rename these types, so we return the original type.
|
|
226
|
+
*/
|
|
227
|
+
renamedType = type;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
/**
|
|
231
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
232
|
+
* For example, `MyType`.
|
|
233
|
+
* We need to rename these types, so we prepend the prefix.
|
|
234
|
+
*/
|
|
235
|
+
renamedType = `I${componentClassName}${type}`;
|
|
236
|
+
}
|
|
222
237
|
}
|
|
223
238
|
return (renamedType
|
|
224
239
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|