Home / Function/ resolve() — express Function Reference

resolve() — express Function Reference

Architecture documentation for the resolve() function in view.js from the express codebase.

Entity Profile

Dependency Diagram

graph TD
  544d2644_38b4_9ea5_7360_cfca18032919["resolve()"]
  f3f6b3ab_6685_aeb3_01fc_79fc5a3a9b41["view.js"]
  544d2644_38b4_9ea5_7360_cfca18032919 -->|defined in| f3f6b3ab_6685_aeb3_01fc_79fc5a3a9b41
  548ad3d1_f590_9d85_c4a5_d888f7aea078["lookup()"]
  548ad3d1_f590_9d85_c4a5_d888f7aea078 -->|calls| 544d2644_38b4_9ea5_7360_cfca18032919
  bc6557a9_8b9f_0aa9_1763_a58074314a4d["tryStat()"]
  544d2644_38b4_9ea5_7360_cfca18032919 -->|calls| bc6557a9_8b9f_0aa9_1763_a58074314a4d
  style 544d2644_38b4_9ea5_7360_cfca18032919 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/view.js lines 169–187

View.prototype.resolve = function resolve(dir, file) {
  var ext = this.ext;

  // <path>.<ext>
  var path = join(dir, file);
  var stat = tryStat(path);

  if (stat && stat.isFile()) {
    return path;
  }

  // <path>/index.<ext>
  path = join(dir, basename(file, ext), 'index' + ext);
  stat = tryStat(path);

  if (stat && stat.isFile()) {
    return path;
  }
};

Domain

Subdomains

Defined In

Calls

Called By

Frequently Asked Questions

What does resolve() do?
resolve() is a function in the express codebase, defined in lib/view.js.
Where is resolve() defined?
resolve() is defined in lib/view.js at line 169.
What does resolve() call?
resolve() calls 1 function(s): tryStat.
What calls resolve()?
resolve() is called by 1 function(s): lookup.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free