Skip to content

Commit

Permalink
toArray -> enforceArray
Browse files Browse the repository at this point in the history
  • Loading branch information
RedYetiDev authored Nov 15, 2024
1 parent 2e49f13 commit 3306460
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/generators/legacy-json/utils/buildSection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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),
};
}

Expand Down

0 comments on commit 3306460

Please sign in to comment.