protected function buildVariableInitialization(string $key, $value) { $variableName = $this->namespace ? "window['{$this->namespace}']['{$key}']" : "window['{$key}']"; return "{$variableName} = {$this->optimizeValueForJavaScript($value)};"; }