Skip to content

Commit

Permalink
Fix json encodes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandedeyne committed Jan 23, 2018
1 parent 8dd4a88 commit 614b5f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public function __toString() : string

protected function environmentScript(): string
{
$context = json_encode($this->context, JSON_FORCE_OBJECT);
$process = json_encode($this->env, JSON_FORCE_OBJECT);
$context = empty($this->context) ? '{}' : json_encode($this->context);
$process = empty($this->env) ? '{}' : json_encode($this->env);

$envAssignments = array_map(function ($value, $key) {
return "process.env.{$key} = " . json_encode($value);
Expand Down

0 comments on commit 614b5f2

Please sign in to comment.