Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "project/util/parseUtils"

Index

Type aliases

Match

Match: M & PatternMatch

Functions

doWithAtMostOneMatch

  • doWithAtMostOneMatch<M, P>(p: P, globPatterns: GlobOptions, microgrammar: Microgrammar<M>, action: function, opts?: Opts): Promise<P>
  • Similar to doWithUniqueMatch, but accepts zero matches without error

    Type parameters

    Parameters

    • p: P

      project

    • globPatterns: GlobOptions
    • microgrammar: Microgrammar<M>
    • action: function
        • (m: M): void
        • Parameters

          • m: M

          Returns void

    • Default value opts: Opts = DefaultOpts

    Returns Promise<P>

doWithFileMatches

  • doWithFileMatches<M, P>(p: P, globPatterns: GlobOptions, microgrammar: Microgrammar<M>, action: function, opts?: Opts): Promise<P>

doWithMatches

  • doWithMatches<M, P>(p: P, globPatterns: GlobOptions, microgrammar: Microgrammar<M>, action: function, opts?: Opts): Promise<P>
  • Convenience function to operate on matches in the project. Works regardless of the number of matches

    Type parameters

    Parameters

    • p: P

      project

    • globPatterns: GlobOptions
    • microgrammar: Microgrammar<M>
    • action: function
        • (m: M): void
        • Parameters

          • m: M

          Returns void

    • Default value opts: Opts = DefaultOpts

    Returns Promise<P>

doWithUniqueMatch

  • doWithUniqueMatch<M, P>(p: P, globPatterns: GlobOptions, microgrammar: Microgrammar<M>, action: function, opts?: Opts): Promise<P>
  • Convenience function to operate on the sole match in the project. Fail if zero or more than one.

    Type parameters

    Parameters

    • p: P

      project

    • globPatterns: GlobOptions
    • microgrammar: Microgrammar<M>
    • action: function
        • (m: M): void
        • Parameters

          • m: M

          Returns void

    • Default value opts: Opts = DefaultOpts

    Returns Promise<P>

findFileMatches

  • Integrate microgrammars with project operations to find all matches

    Type parameters

    • M

    Parameters

    • p: ProjectAsync

      project

    • globPatterns: GlobOptions

      file glob patterns

    • microgrammar: Microgrammar<M>

      microgrammar to run against each eligible file

    • Default value opts: Opts = DefaultOpts

      options

    Returns Promise<Array<FileWithMatches<M>>>

findMatches

  • Integrate microgrammars with project operations to find all matches

    Type parameters

    • M

    Parameters

    • p: ProjectAsync

      project

    • globPatterns: GlobOptions

      file glob patterns

    • microgrammar: Microgrammar<M>

      microgrammar to run against each eligible file

    • Default value opts: Opts = DefaultOpts

      options

    Returns Promise<Array<Match<M>>>

transformIfNecessary

  • transformIfNecessary(rawContent: string, opts: Opts): string

Object literals

Const DefaultOpts

DefaultOpts: object

makeUpdatable

makeUpdatable: true = true

Generated using TypeDoc