Options
All
  • Public
  • Public/Protected
  • All
Menu

Module background/methods/filesystem

Index

Functions

  • getFileExtension(fileName: string): string
  • It reverses the string, finds the position of the first period, then reverses the string again and returns the substring from the beginning of the string to the position of the period

    Parameters

    • fileName: string

      The name of the file you want to get the extension of.

    Returns string

    The file extension of the file name.

  • getPathWithoutName(pathWithName: string, name: string): string
  • It takes a path with a file name and returns the path without the file name

    Parameters

    • pathWithName: string

      The path with the name of the file.

    • name: string

      The name of the file.

    Returns string

    The path without the name.

  • isFileNameValid(name: string): boolean
  • It returns true if the name is not empty, does not contain a slash, and does not contain any of the following characters: ~ # @ * + : ! ? & % < > | " ^ \

    Parameters

    • name: string

      The name of the file to be created.

    Returns boolean

    A function that takes a string and returns a boolean.

  • isFsEntityInFolder(fsEntity: FsEntity, path: string): boolean
  • It returns true if the given fsEntity is in the given folder

    Parameters

    • fsEntity: FsEntity

      The FsEntity that we want to check if it's in the folder.

    • path: string

      The path of the folder you want to check if the fsEntity is in.

    Returns boolean

    A boolean value.

  • removeLeadingBackslash(path: string): string
  • If the path starts with a forward slash, remove it.

    Parameters

    • path: string

      The path to the file you want to read.

    Returns string

    A function that takes a string and returns a string.

  • removeTrailingBackslash(path: string): string
  • If the last character of the path is a forward slash, remove it.

    Parameters

    • path: string

      The path to remove the trailing backslash from.

    Returns string

    A function that takes a string and returns a string.

Generated using TypeDoc version 0.22.15, the 4/20/2022