From 3306460c3e0620ee42ea0bef35ffe226eae23937 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Fri, 15 Nov 2024 08:13:07 -0500 Subject: [PATCH] `toArray` -> `enforceArray` --- src/generators/legacy-json/utils/buildSection.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generators/legacy-json/utils/buildSection.mjs b/src/generators/legacy-json/utils/buildSection.mjs index b831b05..0ef457a 100644 --- a/src/generators/legacy-json/utils/buildSection.mjs +++ b/src/generators/legacy-json/utils/buildSection.mjs @@ -30,7 +30,7 @@ const sectionTypePlurals = { * @param {T | T[]} val - The value to convert. * @returns {T[]} The value as an array. */ -const toArray = val => (Array.isArray(val) ? val : [val]); +const enforceArray = val => (Array.isArray(val) ? val : [val]); /** * Creates metadata from a hierarchized entry. @@ -48,10 +48,10 @@ function createMeta(entry) { return { changes, - added: toArray(added_in), - napiVersion: toArray(n_api_version), - deprecated: toArray(deprecated_in), - removed: toArray(removed_in), + added: enforceArray(added_in), + napiVersion: enforceArray(n_api_version), + deprecated: enforceArray(deprecated_in), + removed: enforceArray(removed_in), }; }