Skip to content

Commit bc07c48

Browse files
committed
Remove prefix param from cleanupIDs plugin
1 parent 53ed57c commit bc07c48

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plugins/cleanupIDs.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ const generateID = (currentID) => {
111111
/**
112112
* Get string from generated ID array.
113113
*
114-
* @type {(arr: Array<number>, prefix: string) => string}
114+
* @type {(arr: Array<number>) => string}
115115
*/
116-
const getIDstring = (arr, prefix) => {
117-
return prefix + arr.map((i) => generateIDchars[i]).join('');
116+
const getIDstring = (arr) => {
117+
return arr.map((i) => generateIDchars[i]).join('');
118118
};
119119

120120
/**
@@ -126,7 +126,6 @@ const getIDstring = (arr, prefix) => {
126126
* @type {import('../lib/types').Plugin<{
127127
* remove?: boolean,
128128
* minify?: boolean,
129-
* prefix?: string,
130129
* preserve?: Array<string>,
131130
* preservePrefixes?: Array<string>,
132131
* force?: boolean,
@@ -136,7 +135,6 @@ exports.fn = (_root, params) => {
136135
const {
137136
remove = true,
138137
minify = true,
139-
prefix = '',
140138
preserve = [],
141139
preservePrefixes = [],
142140
force = false,
@@ -258,7 +256,7 @@ exports.fn = (_root, params) => {
258256
let currentIDString = null;
259257
do {
260258
currentID = generateID(currentID);
261-
currentIDString = getIDstring(currentID, prefix);
259+
currentIDString = getIDstring(currentID);
262260
} while (isIdPreserved(currentIDString));
263261
node.attributes.id = currentIDString;
264262
for (const { element, name, value } of refs) {

0 commit comments

Comments
 (0)