HEX
Server: Apache
System: Linux iad1-shared-b8-33 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: samfetchero1 (10301780)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib/ruby/vendor_ruby/tilt/typescript.rb
require 'tilt/template'
require 'typescript-node'

module Tilt
  class TypeScriptTemplate < Template
    self.default_mime_type = 'application/javascript'

    def prepare
      @option_args = []

      options.each do |key, value|
        next unless value

        @option_args << "--#{key}"

        if value != true
          @option_args << value.to_s
        end
      end
    end

    def evaluate(scope, locals, &block)
      @output ||= TypeScript::Node.compile(data, *@option_args)
    end
  end
end