module Bootsnap::CompileCache::YAML::Psych4::UnsafeLoad

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/bootsnap/compile_cache/yaml.rbs

module Bootsnap::CompileCache::YAML::Psych4::UnsafeLoad
  def storage_to_output: (String data, Hash kwargs) -> untyped
end

def input_to_output(data, kwargs)

def input_to_output(data, kwargs)
  ::YAML.unsafe_load(data, **(kwargs || {}))
end

def input_to_storage(contents, _)

def input_to_storage(contents, _)
  obj = ::YAML.unsafe_load(contents)
  packer = CompileCache::YAML.msgpack_factory.packer
  packer.pack(false) # not safe loaded
  begin
    packer.pack(obj)
  rescue NoMethodError, RangeError
    return UNCOMPILABLE # The object included things that we can't serialize
  end
  packer.to_s
end

def storage_to_output(data, kwargs)

Experimental RBS support (using type sampling data from the type_fusion project).

def storage_to_output: (String data, symbolize_names | TrueClass | freeze | TrueClass kwargs) -> untyped

This signature was generated using 10 samples from 1 application.

def storage_to_output(data, kwargs)
  if kwargs&.key?(:symbolize_names)
    kwargs[:symbolize_keys] = kwargs.delete(:symbolize_names)
  end
  unpacker = CompileCache::YAML.msgpack_factory.unpacker(kwargs)
  unpacker.feed(data)
  _safe_loaded = unpacker.unpack
  unpacker.unpack
end