resolveImports

API / @publicodes/tools / compilation / resolveImports

function resolveImports(
   filePath, 
   rules, 
   logger, 
   verbose): object

Defined in: compilation/resolveImports.ts:259

Resolves the importer! macro inside a publicode file if any.

Parameters

ParameterTypeDefault valueDescription
filePathstringundefinedThe path of the publicode file.
rulesRawRulesundefinedThe rules of the publicode file.
loggerLoggerundefined-
verbosebooleanfalseIf true, logs the imported packages.

Returns

object

The rules of the publicode file with the imported rules.

NameTypeDefined in
completeRulesRawRulescompilation/resolveImports.ts:264
neededNamespacesSet<string>compilation/resolveImports.ts:264

Throws

If the rule to import does not exist.

Throws

If there is double definition of a rule.

Throws

If the imported rule’s publicode raw node “nom” attribute is different from the resolveImport script ruleName.