Imports

loreline.Imports (Class)

Static Members

endsWithLorTxt(path: String): Bool

True if path ends with .lor.txt (case-insensitive on letters).

Name Type
path String
Returns
Bool

endsWithLor(path: String): Bool

True if path ends with .lor (but not .lor.txt).

Name Type
path String
Returns
Bool

lorExtension(path: String): String

Returns the canonical Loreline extension for a path: .lor.txt if the path ends with that, otherwise .lor (also returned for paths with no Loreline extension at all. Matches the fallback used elsewhere).

Name Type
path String
Returns
String

isLorFilePath(path: String): Bool

True if path ends with .lor or .lor.txt.

Name Type
path String
Returns
Bool

stripLorExtension(path: String): String

Strips the Loreline extension from a path. Removes .lor.txt if present, otherwise removes .lor if present, otherwise returns the path unchanged.

Name Type
path String
Returns
String

Instance Members

autoAddExtension: Bool

resolve(rootPath: String, tokens: Tokens, handleFile: ImportsFileHandler, handleError: ImportsErrorHandler, done: ImportsCallback): Void
Name Type
rootPath String
tokens Tokens
handleFile ImportsFileHandler
handleError ImportsErrorHandler
done ImportsCallback

new(): Void

Private Members



tokens: Tokens

rootPath: String

resolvedImports: Map


hasErrors: Bool

pendingImports: Int

ext: String

sameLetterCi(c: Int, lowerExpected: Int): Bool

Returns true if c matches lowerExpected (lowercase ASCII letter) case-insensitively.

Name Type
c Int
lowerExpected Int
Returns
Bool

processImports(toImport: Array<String>, visitedImports: Map, resolvedImports: Map): Void
Name Type
toImport Array<String>
visitedImports Map
resolvedImports Map

handleItemInLoop(item: String, loopInfo: loreline._Imports.ImportsLoopInfo, toImport: Array<String>, visitedImports: Map, resolvedImports: Map): Void
Name Type
item String
loopInfo loreline._Imports.ImportsLoopInfo
toImport Array<String>
visitedImports Map
resolvedImports Map

extractImports(cwd: String, tokens: Tokens, toImport: Array<String>, visitedImports: Map): Void
Name Type
cwd String
tokens Tokens
toImport Array<String>
visitedImports Map