Skip to main content

suggestUtils

Index

Enumerations

Modifier

Modifier:

CARET

CARET: ^

EXACT

EXACT:

TILDE

TILDE: ~

Strategy

Strategy:

CACHE

CACHE: cache

If set, the suggest engine will offer to fulfill the request based on the versions of the package that are already within our cache.

KEEP

KEEP: keep

If set, the suggest engine will offer to keep the current version if the local workspace already depends on it.

LATEST

LATEST: latest

If set, the suggest engine will offer to fulfill the request by using whatever <request-name>@latest would return.

PROJECT

PROJECT: project

If set, the suggest engine will offer to fulfill the request by using any workspace whose name would match the request.

REUSE

REUSE: reuse

If set, the suggest engine will offer to fulfill the request by looking at the ranges currently used by the other workspaces in the project.

Target

Target:

DEVELOPMENT

DEVELOPMENT: devDependencies

PEER

PEER: peerDependencies

REGULAR

REGULAR: dependencies

WorkspaceModifier

WorkspaceModifier:

CARET

CARET: ^

EXACT

EXACT: *

TILDE

TILDE: ~

Type Aliases

FetchDescriptorFromOptions

FetchDescriptorFromOptions: { cache: Cache; project: Project; workspace: Workspace } & ({ modifier?: undefined; preserveModifier?: boolean | string } | { modifier: Modifier; preserveModifier?: undefined })

NullableSuggestion

NullableSuggestion: { descriptor: Descriptor | null; name: string; reason: string }

Type declaration

  • descriptor: Descriptor | null
  • name: string
  • reason: string

Results

Results: { rejections: Error[]; suggestions: NullableSuggestion[] }

Type declaration

Suggestion

Suggestion: { descriptor: Descriptor; name: string; reason: string }

Type declaration

Functions

applyModifier

extractDescriptorFromPath

extractRangeModifier

  • extractRangeModifier(range: string, __namedParameters: { project: Project }): string
  • Parameters

    • range: string
    • __namedParameters: { project: Project }

    Returns string

fetchDescriptorFrom

findProjectDescriptors

getModifier

  • getModifier(flags: { caret: boolean; exact: boolean; tilde: boolean }, project: Project): Modifier
  • Parameters

    • flags: { caret: boolean; exact: boolean; tilde: boolean }
    • project: Project

    Returns Modifier

getSuggestedDescriptors

makeWorkspaceDescriptor

toWorkspaceModifier