module Bootsnap::CompileCache::YAML

def self.input_to_storage(contents, _)

def self.input_to_storage(contents, _)
  raise(Uncompilable) if contents.index("!ruby/object")
  obj = ::YAML.load(contents)
  msgpack_factory.packer.write(obj).to_s
rescue NoMethodError, RangeError
  # if the object included things that we can't serialize, fall back to
  # Marshal. It's a bit slower, but can encode anything yaml can.
  # NoMethodError is unexpected types; RangeError is Bignums
  Marshal.dump(obj)
end