ModuleParser
ModuleParser
new ModuleParser()
The ModuleParser is a utility class designed to loop through and iterate
on a directory and pull out of each .js file found, any classes or exports
that extend from GQLBase or a child of GQLBase.
- Source:
- ModuleParser.js, line 38
Methods
(inner) ⌾⠀initWith(contents, gqlDefinitions) → {Set.<mixed>}
Given an object, typically the result of a require()
or import
command, iterate over its contents and find any GQLBase
derived
exports. Continually, and recursively, build this list of classes out
so that we can add them to a GQLExpressMiddleware
.
Parameters:
Name | Type | Description |
---|---|---|
contents |
mixed | the object to parse for properties extending |
gqlDefinitions |
Array.<GQLBase> | the results, allowed as a second |
Returns:
(
Set.<mixed>
)
a unique set of values that are currently being
iterated over. Passed in as a third parameter to save state between calls
during recursion.
- Source:
- ModuleParser.js, line 88
(inner) ⎆⠀constructor(moduleNameOrModule)
The constructor
Parameters:
Name | Type | Description |
---|---|---|
moduleNameOrModule |
string | mixed | [description] |
- Source:
- ModuleParser.js, line 56