/// Save compiled JS file for given TS module to on-disk cache.
///
/// Along compiled file a special metadata file is saved as well containing
/// hash that can be validated to avoid unnecessary recompilation.
Save compiled JS file for given TS module to on-disk cache.
Along compiled file a special metadata file is saved as well containing
hash that can be validated to avoid unnecessary recompilation.
Save compiled JS file for given TS module to on - disk cache . Along compiled file a special metadata file is saved as well containing hash that can be validated to avoid unnecessary recompilation .
fn cache_compiled_file(
    &self,
    module_specifier: &ModuleSpecifier,
    source_file: SourceFile,
    contents: &str,
  ) -> std::io::Result<()> {
    let js_key = self
      .disk_cache
      .get_cache_filename_with_extension(module_specifier.as_url(), "js");
    self.disk_cache.set(&js_key, contents.as_bytes())?;
    self.mark_compiled(module_specifier.as_url());
    let version_hash = source_code_version_hash(
      &source_file.source_code,
      version::DENO,
      &self.config.hash,
    );
    let compiled_file_metadata = CompiledFileMetadata { version_hash };
    let meta_key = self
      .disk_cache
      .get_cache_filename_with_extension(module_specifier.as_url(), "meta");
    self.disk_cache.set(
      &meta_key,
      compiled_file_metadata.to_json_string()?.as_bytes(),
    )
  }
fn cache_compiled_file ( & self , module_specifier : & ModuleSpecifier , source_file : SourceFile , contents : & str , ) -> std :: io :: Result < ( ) > { let js_key = self . disk_cache . get_cache_filename_with_extension ( module_specifier . as_url ( ) , " " ) ; self . disk_cache . set ( & js_key , contents . as_bytes ( ) ) ? ; self . mark_compiled ( module_specifier . as_url ( ) ) ; let version_hash = source_code_version_hash ( & source_file . source_code , version :: DENO , & self . config . hash , ) ; let compiled_file_metadata = CompiledFileMetadata { version_hash } ; let meta_key = self . disk_cache . get_cache_filename_with_extension ( module_specifier . as_url ( ) , " " ) ; self . disk_cache . set ( & meta_key , compiled_file_metadata . to_json_string ( ) ? . as_bytes ( ) , ) }
Save compiled JS file for given TS module to on-disk cache.
Save compiled JS file for given TS module to on - disk cache .
&self
module_specifier
&ModuleSpecifier
source_file
SourceFile
contents
&str