module Bootsnap::CompileCache::YAML::Psych4::SafeLoad

def input_to_storage(contents, _)

def input_to_storage(contents, _)
  obj = begin
    CompileCache::YAML.strict_load(contents)
  rescue Psych::DisallowedClass, Psych::BadAlias, Uncompilable
    return UNCOMPILABLE
  end
  packer = CompileCache::YAML.msgpack_factory.packer
  packer.pack(true) # safe loaded
  begin
    packer.pack(obj)
  rescue NoMethodError, RangeError
    return UNCOMPILABLE
  end
  packer.to_s
end