Skip to content

Commit

Permalink
check for isHidden in DataTypeScriptTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
hfoletto committed Jul 9, 2024
1 parent d16cad5 commit c4bbd08
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Spatie\LaravelData\Support\DataProperty;
use Spatie\LaravelData\Support\Lazy\ClosureLazy;
use Spatie\LaravelTypeScriptTransformer\Transformers\DtoTransformer;
use Spatie\TypeScriptTransformer\Attributes\Hidden;
use Spatie\TypeScriptTransformer\Attributes\Optional as TypeScriptOptional;
use Spatie\TypeScriptTransformer\Structures\MissingSymbolsCollection;
use Spatie\TypeScriptTransformer\TypeProcessors\DtoCollectionTypeProcessor;
Expand Down Expand Up @@ -68,6 +69,12 @@ function (string $carry, ReflectionProperty $property) use ($isOptional, $dataCl
return $carry;
}

$isHidden = ! empty($property->getAttributes(Hidden::class));

if ($isHidden) {
return $carry;
}

$isOptional = $isOptional
|| $dataProperty->attributes->contains(
fn (object $attribute) => $attribute instanceof TypeScriptOptional
Expand Down

0 comments on commit c4bbd08

Please sign in to comment.