In checking the condition to handle the path for addonapi
when require('addonapi') is called, it needs to check the
process type to know which process calls the module.
However, there's improper condition for process type.
That makes it unable to use addonapi regardless of process type.
This changes the condition so it can use addonapi
when the process type is valid.
Change-Id: I8c58c5f8d98041c2e21ce970b7a5a1ab927f8cf6
Signed-off-by: hyunduk.kim <hyunduk.kim@samsung.com>
const originalResolveFilename = Module._resolveFilename;
Module._resolveFilename = function (request: string, parent: NodeModule, isMain: boolean) {
- if (request === 'addonapi' && !process.type)
+ if (request === 'addonapi' && process.type)
return path.join(__dirname, '..', 'addon', process.type as string, 'addonapi.js');
else
return originalResolveFilename(request, parent, isMain);
-}
\ No newline at end of file
+}