summaryrefslogtreecommitdiff
path: root/node_modules/svgo/plugins/cleanupIds.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/svgo/plugins/cleanupIds.js')
-rw-r--r--node_modules/svgo/plugins/cleanupIds.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/node_modules/svgo/plugins/cleanupIds.js b/node_modules/svgo/plugins/cleanupIds.js
index 65b38d16..bfabcca5 100644
--- a/node_modules/svgo/plugins/cleanupIds.js
+++ b/node_modules/svgo/plugins/cleanupIds.js
@@ -69,7 +69,7 @@ const maxIdIndex = generateIdChars.length - 1;
/**
* Check if an ID starts with any one of a list of strings.
*
- * @type {(string: string, prefixes: Array<string>) => boolean}
+ * @type {(string: string, prefixes: string[]) => boolean}
*/
const hasStringPrefix = (string, prefixes) => {
for (const prefix of prefixes) {
@@ -109,7 +109,7 @@ const generateId = (currentId) => {
/**
* Get string from generated ID array.
*
- * @type {(arr: Array<number>) => string}
+ * @type {(arr: number[]) => string}
*/
const getIdString = (arr) => {
return arr.map((i) => generateIdChars[i]).join('');
@@ -132,19 +132,19 @@ exports.fn = (_root, params) => {
force = false,
} = params;
const preserveIds = new Set(
- Array.isArray(preserve) ? preserve : preserve ? [preserve] : []
+ Array.isArray(preserve) ? preserve : preserve ? [preserve] : [],
);
const preserveIdPrefixes = Array.isArray(preservePrefixes)
? preservePrefixes
: preservePrefixes
- ? [preservePrefixes]
- : [];
+ ? [preservePrefixes]
+ : [];
/**
* @type {Map<string, XastElement>}
*/
const nodeById = new Map();
/**
- * @type {Map<string, Array<{element: XastElement, name: string }>>}
+ * @type {Map<string, {element: XastElement, name: string }[]>}
*/
const referencesById = new Map();
let deoptimized = false;
@@ -236,13 +236,13 @@ exports.fn = (_root, params) => {
// replace id in href and url()
element.attributes[name] = value.replace(
`#${encodeURI(id)}`,
- `#${currentIdString}`
+ `#${currentIdString}`,
);
} else {
// replace id in begin attribute
element.attributes[name] = value.replace(
`${id}.`,
- `${currentIdString}.`
+ `${currentIdString}.`,
);
}
}