4 module Puppet::Parser::Functions
5 newfunction(:lstrip, :type => :rvalue, :doc => <<-DOC
7 **Deprecated:** Strips leading spaces to the left of a string.
12 > **Note:** **Deprecated** from Puppet 6.0.0, this function has been replaced with a
13 built-in [`max`](https://puppet.com/docs/puppet/latest/function.html#max) function.
17 raise(Puppet::ParseError, "lstrip(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
21 unless value.is_a?(Array) || value.is_a?(String)
22 raise(Puppet::ParseError, 'lstrip(): Requires either array or string to work with')
25 result = if value.is_a?(Array)
26 # Numbers in Puppet are often string-encoded which is troublesome ...
27 value.map { |i| i.is_a?(String) ? i.lstrip : i }
36 # vim: set ts=2 sw=2 et :