Sha256: 0387e58c12bdc1cfa35994677b0c98d9f92f5e26f69b267c06332bb385bd808f

Contents?: true

Size: 451 Bytes

Versions: 6

Compression:

Stored size: 451 Bytes

Contents

# frozen_string_literal: true

module Handlebarsjs
  module Helpers
    # Miscellaneous cmdlets
    module Misc
      # Safe: pass through the value with <> and single and double quotes left as is
      class Safe < Handlebarsjs::BaseHelper
        register_cmdlet(Cmdlet::Misc::Safe, safe: true, parameter_names: %i[value])

        def to_proc
          ->(value, _opts) { wrapper(cmdlet.call(value)) }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
handlebarsjs-0.14.2 lib/handlebarsjs/helpers/misc/safe.rb
handlebarsjs-0.14.1 lib/handlebarsjs/helpers/misc/safe.rb
handlebarsjs-0.14.0 lib/handlebarsjs/helpers/misc/safe.rb
handlebarsjs-0.13.1 lib/handlebarsjs/helpers/misc/safe.rb
handlebarsjs-0.13.0 lib/handlebarsjs/helpers/misc/safe.rb
handlebarsjs-0.12.0 lib/handlebarsjs/helpers/misc/safe.rb