@servicenow/sdk - v4.7.0
    Preparing search index...

    Function getImpliedNodeFormatForFile

    • A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the options parameter.

      Parameters

      • fileName: string

        The file name to check the format of (it need not exist on disk)

      • OptionalpackageJsonInfoCache: PackageJsonInfoCache

        A cache for package file lookups - it's best to have a cache when this function is called often

      • host: ModuleResolutionHost

        The ModuleResolutionHost which can perform the filesystem lookups for package json data

      • options: tsc.CompilerOptions

        The compiler options to perform the analysis under - relevant options are moduleResolution and traceResolution

      Returns ResolutionMode

      undefined if the path has no relevant implied format, ModuleKind.ESNext for esm format, and ModuleKind.CommonJS for cjs format