Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
refactor: use Kirby json encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed May 23, 2022
1 parent 74bd23a commit 1881c49
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions site/plugins/kirby-vite/classes/KirbyExtended/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ protected function assetProd(string $file): string
*/
public function css(string $entry = null, array $options = []): ?string
{
if ($this->isDev()) return null;
if ($this->isDev()) {
return null;
}

$entry ??= option('johannschopplich.kirby-vite.entry', 'index.js');
$attr = array_merge($options, [
Expand Down Expand Up @@ -203,7 +205,9 @@ public function preloadJson(string $name): string
*/
public function preloadModule(string $name): ?string
{
if ($this->isDev()) return null;
if ($this->isDev()) {
return null;
}

$match = array_filter(
$this->useManifest(),
Expand All @@ -227,7 +231,7 @@ public function preloadModule(string $name): ?string
*/
public function json(array $data): string
{
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
return \Kirby\Data\Json::encode($data);
}

/**
Expand Down

0 comments on commit 1881c49

Please sign in to comment.