BC-LifeHash-CLI TypeScript Library - v1.0.0-alpha.20
    Preparing search index...

    Function appendingPathComponent

    • Appends a path component to a path, handling trailing slashes correctly.

      Port of appending_path_component() from lifehash.cpp lines 18-24.

      Parameters

      • path: string

        The base path

      • component: string

        The component to append

      Returns string

      The combined path

      appendingPathComponent("", "file.png") // => "file.png"
      appendingPathComponent("/tmp/", "file.png") // => "/tmp/file.png"
      appendingPathComponent("/tmp", "file.png") // => "/tmp/file.png"