mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
Remove unused webdriver-manager dependency to eliminate vulnerable form-data ~2.3.2 (#11060)
* Initial plan * Remove webdriver-manager to eliminate form-data ~2.3.2 dependency Co-authored-by: eromano <1030050+eromano@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eromano <1030050+eromano@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.processDocs = void 0;
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var unist_util_select_1 = require("unist-util-select");
|
||||
'use strict';
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
exports.processDocs = processDocs;
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var unist_util_select_1 = require('unist-util-select');
|
||||
var suffixesNotToCheck = /\.ts/;
|
||||
function processDocs(mdCache, aggData) {
|
||||
var pathnames = Object.keys(mdCache);
|
||||
@@ -16,7 +32,6 @@ function processDocs(mdCache, aggData) {
|
||||
fixUrls(tree, pathname, imageSet, 'image');
|
||||
});
|
||||
}
|
||||
exports.processDocs = processDocs;
|
||||
function fixUrls(tree, docFilePath, linkSet, selector) {
|
||||
var linksInDoc = (0, unist_util_select_1.selectAll)(selector, tree);
|
||||
var errors = [];
|
||||
@@ -28,20 +43,22 @@ function fixUrls(tree, docFilePath, linkSet, selector) {
|
||||
anchor = origFullUrlPath.substring(hashPos);
|
||||
origFullUrlPath = origFullUrlPath.substring(0, hashPos);
|
||||
}
|
||||
if (!linkElem.url.match(/http:|https:|ftp:|mailto:/) &&
|
||||
if (
|
||||
!linkElem.url.match(/http:|https:|ftp:|mailto:/) &&
|
||||
!path.extname(origFullUrlPath).match(suffixesNotToCheck) &&
|
||||
(origFullUrlPath !== '') &&
|
||||
!fs.existsSync(origFullUrlPath)) {
|
||||
origFullUrlPath !== '' &&
|
||||
!fs.existsSync(origFullUrlPath)
|
||||
) {
|
||||
var newUrl = linkSet.update(origFullUrlPath) || origFullUrlPath;
|
||||
linkElem.url = path.relative(path.dirname(docFilePath), newUrl).replace(/\\/g, '/') + anchor;
|
||||
errors.push("Bad link: ".concat(origFullUrlPath, "\nReplacing with ").concat(linkElem.url));
|
||||
errors.push('Bad link: '.concat(origFullUrlPath, '\nReplacing with ').concat(linkElem.url));
|
||||
} /*else {
|
||||
console.log(`Link OK: ${origFullUrlPath}`);
|
||||
}
|
||||
*/
|
||||
});
|
||||
if (errors.length > 0) {
|
||||
showMessages("File: ".concat(docFilePath, ":"), errors);
|
||||
showMessages('File: '.concat(docFilePath, ':'), errors);
|
||||
}
|
||||
}
|
||||
function showMessages(groupName, messages) {
|
||||
@@ -52,8 +69,9 @@ function showMessages(groupName, messages) {
|
||||
console.groupEnd();
|
||||
}
|
||||
function getImagePaths(imageFolderPath) {
|
||||
return fs.readdirSync(imageFolderPath)
|
||||
.map(function (imageFileName) { return path.resolve(imageFolderPath, imageFileName); });
|
||||
return fs.readdirSync(imageFolderPath).map(function (imageFileName) {
|
||||
return path.resolve(imageFolderPath, imageFileName);
|
||||
});
|
||||
}
|
||||
var LinkSet = /** @class */ (function () {
|
||||
function LinkSet(urls) {
|
||||
@@ -64,8 +82,7 @@ var LinkSet = /** @class */ (function () {
|
||||
if (_this.links.has(fileName)) {
|
||||
var item = _this.links.get(fileName);
|
||||
item.push(url);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
_this.links.set(fileName, [url]);
|
||||
}
|
||||
});
|
||||
@@ -74,17 +91,15 @@ var LinkSet = /** @class */ (function () {
|
||||
var oldFileName = path.basename(oldUrl);
|
||||
if (!this.links.has(oldFileName)) {
|
||||
return '';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var candidates = this.links.get(oldFileName);
|
||||
if (candidates.length === 1) {
|
||||
return candidates[0];
|
||||
}
|
||||
else {
|
||||
console.log("Multiple candidates for ".concat(oldUrl));
|
||||
} else {
|
||||
console.log('Multiple candidates for '.concat(oldUrl));
|
||||
return '';
|
||||
}
|
||||
}
|
||||
};
|
||||
return LinkSet;
|
||||
}());
|
||||
})();
|
||||
|
Reference in New Issue
Block a user