Skip to content

Commit f80ab4e

Browse files
committed
si una interface tiene relación con si misma, no hacer import
1 parent 5fe8247 commit f80ab4e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ParseTypeScript/TypeScriptBaseInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ public function __toString()
3434
$imports = [];
3535
$pieces = [];
3636
foreach ($this->properties as $property) {
37+
3738
if (in_array($property->type, ['number', 'string', 'boolean', 'any[]']) === false) {
3839
$rel = str_replace('[]', '', $property->type);
39-
$imports[] = 'import { ' . $rel . ' } from "./' . $rel . '";';
40+
if ($this->name !== $rel) {
41+
$imports[] = 'import { ' . $rel . ' } from "./' . $rel . '";';
42+
}
4043
}
4144

4245
$pieces[] = " " . $property->name . ": " . $property->type . ";";

0 commit comments

Comments
 (0)