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
Parameter | Type | Default value | Description |
---|---|---|---|
filePath | string | undefined | The path of the publicode file. |
rules | RawRules | undefined | The rules of the publicode file. |
logger | Logger | undefined | - |
verbose | boolean | false | If true, logs the imported packages. |
Returns
object
The rules of the publicode file with the imported rules.
Name | Type | Defined in |
---|---|---|
completeRules | RawRules | compilation/resolveImports.ts:264 |
neededNamespaces | Set <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.