Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Utilities

Index

Functions

ensurePathHasExtension

  • ensurePathHasExtension(path: string, extension: string): string
  • Updates the provided path to make sure it ends with the provided file extension

    Parameters

    • path: string

      File path

    • extension: string

      File extension

    Returns string

    The passed in path with the provided file extension

getFileExtension

  • getFileExtension(path: string): string
  • Gets the file extension of the passed in file name or path

    Parameters

    • path: string

      Path to get the file extension from

    Returns string

    File extension

getFilename

  • getFilename(path: string, trimExtension?: boolean): string
  • Gets the file name of the provided path, while optionally trimming the file extension

    Parameters

    • path: string

      File path to retrieve the name for

    • Default value trimExtension: boolean = false

      Whether or not to trim the extension from the file name (defaults to false)

    Returns string

    The file name from the path

getRelativeUrl

  • getRelativeUrl(absoluteUrl: string, relativeTo: string): string
  • Converts the provided absolute URL to a URL relative to the current page's URL

    Parameters

    • absoluteUrl: string

      Absolute URL to convert to a relative URL

    • relativeTo: string

      URL to make the URL relative to

    Returns string

    The converted URL

Generated using TypeDoc