Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/sdm/binding/project/expandedTreeUtils"

Index

Variables

Const OwnerAndRepoPattern

OwnerAndRepoPattern: RegExp = new RegExp(["^", "([^", "]+)", "([^", "]+)$"].join(sep))

Const OwnerOnlyPattern

OwnerOnlyPattern: RegExp = new RegExp(["^", "([^", "]+)$"].join(sep))

Const sep

sep: "/" | "\\" = (path.sep === "\\") ? "\\\\" : path.sep

Functions

cygwinizePath

  • cygwinizePath(dir: string): string
  • Transform native win32 path to a cygwin path. All backslashes in the path are replaced forward slashes and any leading drive letter is incorprated into the path as a lowercased first directory of the path.

    Parameters

    • dir: string

      original path

    Returns string

    cygwinized path

determineCwd

  • determineCwd(): string

dirFor

  • dirFor(repositoryOwnerParentDirectory: string, owner: string, repo: string): string

isWithin

  • isWithin(repositoryOwnerParentDirectory: string, baseDir: string): boolean
  • Determine whether baseDir is under repositoryOwnerparentdirectory. On win32, the comparison is done in a case-insensitive way and also tries to deal with Cygwin-style paths.

    Parameters

    • repositoryOwnerParentDirectory: string

      parent directory

    • baseDir: string

      putative child directory

    Returns boolean

    true if baseDir is under repositoryownerparentdirectory

parseOwnerAndRepo

  • parseOwnerAndRepo(repositoryOwnerParentDirectory: string, baseDir?: string): object
  • Find the owner and repo from the given directory, returning the empty object if it isn't within our expanded directory structure

    Parameters

    • repositoryOwnerParentDirectory: string
    • Default value baseDir: string = determineCwd()

      directory to test

    Returns object

    • Optional owner?: string
    • Optional repo?: string

trimTrailingSlash

  • trimTrailingSlash(dir: string): string

withinExpandedTree

  • withinExpandedTree(repositoryOwnerParentDirectory: string, baseDir?: string): boolean
  • Is the given directory within the expanded directory tree?

    Parameters

    • repositoryOwnerParentDirectory: string
    • Default value baseDir: string = determineCwd()

      directory to test

    Returns boolean

Generated using TypeDoc