@param array  $config
@param string $moduleName
@param bool   $async

@return null|string
@throws NotFoundHttpException
761370
public static function getJsModuleTags(array $config, string $moduleName, bool $async)
    {
        $legacyModule = self::getModule($config, $moduleName, 'legacy', true);
        if ($legacyModule === null) {
            return '';
        }
        if ($async) {
            $modernModule = self::getModule($config, $moduleName, 'modern', true);
            if ($modernModule === null) {
                return '';
            }
        }
        $lines = [];
        if ($async) {
            $lines[] = "<script type=\"module\" src=\"{$modernModule}\"></script>";
            $lines[] = "<script nomodule src=\"{$legacyModule}\"></script>";
        } else {
            $lines[] = "<script src=\"{$legacyModule}\"></script>";
        }

        return implode("\r\n", $lines);
    }
1130246
public function addAsyncJs($relativeUrl, string $moduleNamespace = null, $prepend = false) {
		if ($moduleNamespace === null) {
			$moduleNamespace = $this->view->getModuleNamespace();
		}
		
		$this->addAsyncJsUrl($this->view->getHttpContext()->getAssetsUrl($moduleNamespace)->ext($relativeUrl), (boolean) $prepend);
		
		return $this;
	}
724683
public function getCssModuleTags(string $moduleName, bool $async = false, $config = null): string
    {
        $settings = Twigpack::$plugin->getSettings();
        $config = $config ?? $settings->getAttributes();

        return ManifestHelper::getCssModuleTags($config, $moduleName, $async);
    }
723863
public function moduleContent($moduleName)
    {
        if ($this->isAdminContext() || empty($moduleName) || count($this->getEnvOptions()) === 0 || !Yii::$app->hasModule($moduleName)) {
            return;
        }
        
        // get module
        $module = Yii::$app->getModule($moduleName);
        $module->context = 'cms';
        
        // start module reflection
        $reflection = Yii::createObject(['class' => ModuleReflection::class, 'module' => $module]);
        $reflection->suffix = $this->getEnvOption('restString');

        $args = Json::decode($this->getCfgValue('moduleActionArgs', '{}'));
        
        // if a controller has been defined we inject a custom starting route for the
        // module reflection object.
        $ctrl = $this->getCfgValue('moduleController');
        if (!empty($ctrl)) {
            $reflection->defaultRoute($ctrl, $this->getCfgValue('moduleAction', 'index'), $args);
        }
        
        if ($this->getCfgValue('strictRender')) {
            $reflection->setRequestRoute(implode("/", [$this->getCfgValue('moduleController', $module->defaultRoute), $this->getCfgValue('moduleAction', 'index')]), $args);
        } else {
            Yii::$app->request->queryParams = array_merge($reflection->getRequestRoute()['args'], Yii::$app->request->queryParams);
        }

        $response = $reflection->run();
        
        if ($response instanceof Response) {
            return Yii::$app->end(0, $response);
        }
        
        return $response;
    }
533801
async function _default(config, routesConfig) {
  const res = await (0, _startApp.default)(config);
  const {
    url,
    app,
    router,
    middleware,
    connect
  } = res;
  let methods;

  if (routesConfig) {
    methods = await (0, _routes.initRoutes2)(routesConfig, middleware, router);
    const routes = router.routes();
    app.use(routes);
  }

  return {
    url,
    app,
    connect,
    methods,
    router
  };
}
293142
protected function generateModules(array $config, array $modules, ?GridIterator $iterator = null): array
    {
        $buffer = [];

        foreach ($config as $entry) {
            if ($entry['inactive'] || !$entry['module']) {
                continue;
            }

            if (is_numeric($entry['module'])) {
                if (!empty($modules[$entry['module']])) {
                    $buffer[] = $modules[$entry['module']];
                }

                continue;
            }

            if ($iterator) {
                $iterator->next();

                foreach ($iterator->resets() as $reset) {
                    $buffer[] = '<div class="clearfix w-100 ' . $reset . '"></div>';
                }

                $buffer[] = sprintf(
                    "\n" . '</div>' . "\n" . '<div class="%s">',
                    $iterator->current()
                );
            }
        }

        return $buffer;
    }
1364345
public function buildScript($src, $async = false)
    {
        // Build the script element
        $script = $this->buildHtmlElement($name = 'script', $value = '', $id = '', $class = '');
        $script->attr('src', $src);
        $script->attr('async', $async);

        // Return the script
        return $script;
    }
147937
async function _tryModule(modulePath, defaultReturnValue) {
  try {
    return await requireAsync({squashErrors:true}, modulePath.shift());
  } catch (err) { }
  if(!modulePath.length) return defaultReturnValue;
  return _tryModule(modulePath, defaultReturnValue);
}
173772
public function config_read($name) {
        global $CFG;
        if (!empty($this->plugin)) {
            $value = get_config($this->plugin, $name);
            return $value === false ? NULL : $value;

        } else {
            if (isset($CFG->$name)) {
                return $CFG->$name;
            } else {
                return NULL;
            }
        }
    }
670980
function(config) {
    var app = null;
    try {
      app = module.exports.createApp(config);
    } catch (err) {
      // wrap also synchronous error to promise to have consistent API for catching all errors
      return Promise.reject(err);
    }
    return module.exports.startApp(app);
  }
937582
protected function makeConnection($name, array $config)
    {
        $timeout = isset($config['timeout']) ? $config['timeout'] : 10;

        $this->setOutput($connection = new Connection(

            $name, $config['host'], $config['username'], $this->getAuth($config), null, $timeout

        ));

        return $connection;
    }
64886
public function setAsync($async)
    {
        if ($this->version2)
            return $this;
        $this->async = $async;
        $this->asyncString = $async ? "Async" : "";
        return $this;
    }
1135487
public static function get($name, $config = NULL)
    {
        if(isset($_COOKIE[$name]))
        {
            // Decrypt cookie using cookie key
            if($v = json_decode(Cipher::decrypt(base64_decode($_COOKIE[$name]), Config::config()->key), true))
            {
                return $v;
            }
        }

        return FALSE;
    }
764757
public function get($module, $name, $default = false)
    {
        $this->initializeOnDemand();
        return $this->arrayConfig->get($module, $name, $default);
    }
1045370
public function getModuleById($moduleId)
    {
        foreach ($this->getModules() as $module) {
            if ($module->getModuleId() == $moduleId) {
                return $module;
            }
        }

        return null;
    }
481611
protected function errorIfCompiledBlacklistIsEmpty(Config $config): ?Error
    {
        $blacklist = $config->compileBlacklist();

        return empty($blacklist)
            ? ResultFactory::makeError($this, 'Blacklist is empty.')
            : null;
    }
303467
function hasLoaded($moduleName)
    {
        if (!is_string($moduleName))
            throw new \InvalidArgumentException(sprintf(
                'Invalid module name, "%s".'
                , \Poirot\Std\flatten($moduleName)
            ));

        return in_array($moduleName, $this->listLoadedModules());
    }