Skip to content

Commit

Permalink
Remove prefix param from cleanupIDs plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Oct 23, 2022
1 parent 53ed57c commit bc07c48
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugins/cleanupIDs.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ const generateID = (currentID) => {
/**
* Get string from generated ID array.
*
* @type {(arr: Array<number>, prefix: string) => string}
* @type {(arr: Array<number>) => string}
*/
const getIDstring = (arr, prefix) => {
return prefix + arr.map((i) => generateIDchars[i]).join('');
const getIDstring = (arr) => {
return arr.map((i) => generateIDchars[i]).join('');
};

/**
Expand All @@ -126,7 +126,6 @@ const getIDstring = (arr, prefix) => {
* @type {import('../lib/types').Plugin<{
* remove?: boolean,
* minify?: boolean,
* prefix?: string,
* preserve?: Array<string>,
* preservePrefixes?: Array<string>,
* force?: boolean,
Expand All @@ -136,7 +135,6 @@ exports.fn = (_root, params) => {
const {
remove = true,
minify = true,
prefix = '',
preserve = [],
preservePrefixes = [],
force = false,
Expand Down Expand Up @@ -258,7 +256,7 @@ exports.fn = (_root, params) => {
let currentIDString = null;
do {
currentID = generateID(currentID);
currentIDString = getIDstring(currentID, prefix);
currentIDString = getIDstring(currentID);
} while (isIdPreserved(currentIDString));
node.attributes.id = currentIDString;
for (const { element, name, value } of refs) {
Expand Down

0 comments on commit bc07c48

Please sign in to comment.