From 0e39a6fcf225937d3847a4af311751e04653c2c6 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Tue, 19 Nov 2024 19:27:37 +0900 Subject: [PATCH] Allow to get interfaces without generating typescript files --- lib/typelizer/generator.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/typelizer/generator.rb b/lib/typelizer/generator.rb index 9ac4224..2ecc677 100644 --- a/lib/typelizer/generator.rb +++ b/lib/typelizer/generator.rb @@ -16,14 +16,18 @@ def initialize(config = Typelizer::Config) def call(force: false) return unless Typelizer.enabled? - read_serializers - - interfaces = target_serializers.map(&:typelizer_interface).reject(&:empty?) writer.call(interfaces, force: force) interfaces end + def interfaces + @interfaces ||= begin + read_serializers + target_serializers.map(&:typelizer_interface).reject(&:empty?) + end + end + private def target_serializers