lib/floe/workflow/intrinsic_function/transformer.rb in floe-0.13.0 vs lib/floe/workflow/intrinsic_function/transformer.rb in floe-0.13.1
- old
+ new
@@ -78,11 +78,11 @@
rule(:jsonpath => simple(:v)) { Floe::Workflow::Path.value(v.to_s, context, input) }
STATES_FORMAT_PLACEHOLDER = /(?<!\\)\{\}/.freeze
rule(:states_format => {:args => subtree(:args)}) do
- args = Transformer.process_args(args(), "States.Format", [String, VariadicArgs[[String, TrueClass, FalseClass, Integer, Float, NilClass]]])
+ args = Transformer.process_args(args(), "States.Format", [String, VariadicArgs[[String, TrueClass, FalseClass, Numeric, NilClass]]])
str, *rest = *args
# TODO: Handle templates with escaped characters, including invalid templates
# See https://states-language.net/#intrinsic-functions (number 6)
@@ -189,15 +189,11 @@
raise ArgumentError, "invalid value for argument 1 to States.Base64Decode (#{err})"
end
end
rule(:states_hash => {:args => subtree(:args)}) do
- args = Transformer.process_args(args(), "States.Hash", [Object, String])
+ args = Transformer.process_args(args(), "States.Hash", [[String, TrueClass, FalseClass, Numeric, Array, Hash], String])
data, algorithm = *args
-
- if data.nil?
- raise ArgumentError, "invalid value for argument 1 to States.Hash (given null, expected non-null)"
- end
algorithms = %w[MD5 SHA-1 SHA-256 SHA-384 SHA-512]
unless algorithms.include?(algorithm)
raise ArgumentError, "invalid value for argument 2 to States.Hash (given #{algorithm.inspect}, expected one of #{algorithms.map(&:inspect).join(", ")})"
end