From 135e8a4d8d53a81f62c9d5fe281b129eb35a1f34 Mon Sep 17 00:00:00 2001 From: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:57:29 +1200 Subject: [PATCH] Fix for page detection in some cases --- src/util/json.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/util/json.js b/src/util/json.js index 02c63a5..5bf687e 100644 --- a/src/util/json.js +++ b/src/util/json.js @@ -2,17 +2,17 @@ const { configure } = require('safe-stable-stringify'); const stringify = configure({ deterministic: false }); -function replacer(key, value) { - const isNotPage = !value - || typeof value !== 'object' - || !Object.prototype.hasOwnProperty.call(value, 'template') - || !Object.prototype.hasOwnProperty.call(value, 'inputPath') - || !Object.prototype.hasOwnProperty.call(value, 'fileSlug') - || !Object.prototype.hasOwnProperty.call(value, 'filePathStem') - || !Object.prototype.hasOwnProperty.call(value, 'data') - || !Object.prototype.hasOwnProperty.call(value, 'templateContent'); +function replacer(_key, value) { + const isPage = value + && typeof value === 'object' + && Object.prototype.hasOwnProperty.call(value, 'template') + && Object.prototype.hasOwnProperty.call(value, 'inputPath') + && Object.prototype.hasOwnProperty.call(value, 'fileSlug') + && Object.prototype.hasOwnProperty.call(value, 'filePathStem') + && Object.prototype.hasOwnProperty.call(value, 'data') + && Object.prototype.hasOwnProperty.call(value, 'templateContent'); - return isNotPage ? value : '[FILTERED]'; + return isPage ? '[FILTERED]' : value; } function stringifyJson(obj, fallback) {