I'm working with a fork of an open source project that is a Node.JS app. Given the code below, what does the first parenthetical expression do when it comes to executing the .onNetwork() method call attached to the second parenthetical expression? I have never seen this style of Javascript call before and I'm not sure how to parse it to form the correct execution model in my head.
I'm referring to this line to this line from the code shown below:
(0, _ControllerFor2.default)(packageFileName).onNetwork(Network, txParams, networkFileName);
I have never seen two parenthetical expression in a row preceded a method call. To be specific, I'm breaking the line above down as:
First parenthetical expression: (0, _ControllerFor2.default)
Second parenthetical expression: (packageFileName)
Method call: .onNetwork(Network, txParams, networkFileName)
If someone could explain what happens with each part of this line referring to the three parts I have labeled above, and describe what really happens with the .onNetwork() method as a result, that would be very helpful. Links to the appropriate Javascript language pages that describe these constructs would be appreciated too since I'm not sure how to describe them during a web search.
Open source GitHub repo the code is from:
https://github.com/zeppelinos/zos-cli
Host Javascript source file "scripts/push.js":
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ControllerFor = require("../models/local/ControllerFor");
var _ControllerFor2 = _interopRequireDefault(_ControllerFor);
var _stdout = require("../utils/stdout");
var _stdout2 = _interopRequireDefault(_stdout);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = async function push({ network, deployStdlib, reupload = false, txParams = {}, packageFileName = undefined, networkFileName = undefined }) {
// This is the line I am referring to in the text above.
const appController = (0, _ControllerFor2.default)(packageFileName).onNetwork(network, txParams, networkFileName);
try {
if (deployStdlib && !appController.isLib()) {
await appController.deployStdlib();
}
await appController.push(reupload);
(0, _stdout2.default)(appController.isLib() ? appController.packageAddress : appController.appAddress);
} finally {
appController.writeNetworkPackage();
}
};