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), }; }