Skip to content

Commit a268a08

Browse files
Merge pull request #53 from Bloemendaal/main
fix: don't create a compound type when the type is already a TypeScript type
2 parents a5596f7 + 973cab0 commit a268a08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/TypeProcessors/LaravelCollectionTypeProcessor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use ReflectionUnionType;
1616
use Spatie\TypeScriptTransformer\Structures\MissingSymbolsCollection;
1717
use Spatie\TypeScriptTransformer\TypeProcessors\TypeProcessor;
18+
use Spatie\TypeScriptTransformer\Types\TypeScriptType;
1819

1920
class LaravelCollectionTypeProcessor implements TypeProcessor
2021
{
@@ -31,6 +32,10 @@ public function process(
3132
return $type;
3233
}
3334

35+
if ($type instanceof TypeScriptType) {
36+
return $type;
37+
}
38+
3439
if ($this->isLaravelCollectionObject($type)) {
3540
return new Array_();
3641
}

0 commit comments

Comments
 (0)