mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-22 19:41:08 +07:00
Bump node-fetch from 2.6.0 to 2.6.1 (#127)
* Bump node-fetch from 2.6.0 to 2.6.1 Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <support@github.com> * Package and index update * Formatting on installer.test * Updated licenses Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zachary Eisinger <zeisinger@github.com>
This commit is contained in:
parent
a1c7110c2a
commit
9d7c66c348
BIN
.licenses/npm/@actions/core.dep.yml
generated
BIN
.licenses/npm/@actions/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/uuid.dep.yml
generated
BIN
.licenses/npm/uuid.dep.yml
generated
Binary file not shown.
@ -27,15 +27,16 @@ describe('version tests', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
each([['3.1.x', '3.1'], ['1.1.*', '1.1'], ['2.0', '2.0']]).test(
|
each([
|
||||||
"Generic version '%s' should be '%s'",
|
['3.1.x', '3.1'],
|
||||||
(vers, resVers) => {
|
['1.1.*', '1.1'],
|
||||||
|
['2.0', '2.0']
|
||||||
|
]).test("Generic version '%s' should be '%s'", (vers, resVers) => {
|
||||||
let versInfo = new installer.DotNetVersionInfo(vers);
|
let versInfo = new installer.DotNetVersionInfo(vers);
|
||||||
|
|
||||||
expect(versInfo.isExactVersion()).toBe(false);
|
expect(versInfo.isExactVersion()).toBe(false);
|
||||||
expect(versInfo.version()).toBe(resVers);
|
expect(versInfo.version()).toBe(resVers);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
each([
|
each([
|
||||||
'',
|
'',
|
||||||
|
562
dist/index.js
vendored
562
dist/index.js
vendored
@ -560,13 +560,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const os = __webpack_require__(87);
|
const os = __importStar(__webpack_require__(87));
|
||||||
const events = __webpack_require__(614);
|
const events = __importStar(__webpack_require__(614));
|
||||||
const child = __webpack_require__(129);
|
const child = __importStar(__webpack_require__(129));
|
||||||
const path = __webpack_require__(622);
|
const path = __importStar(__webpack_require__(622));
|
||||||
const io = __webpack_require__(1);
|
const io = __importStar(__webpack_require__(1));
|
||||||
const ioUtil = __webpack_require__(672);
|
const ioUtil = __importStar(__webpack_require__(672));
|
||||||
/* eslint-disable @typescript-eslint/unbound-method */
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
/*
|
/*
|
||||||
@ -1010,6 +1017,12 @@ class ToolRunner extends events.EventEmitter {
|
|||||||
resolve(exitCode);
|
resolve(exitCode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (this.options.input) {
|
||||||
|
if (!cp.stdin) {
|
||||||
|
throw new Error('child process missing stdin');
|
||||||
|
}
|
||||||
|
cp.stdin.end(this.options.input);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -4040,9 +4053,9 @@ module.exports = opts => {
|
|||||||
const util = __webpack_require__(343);
|
const util = __webpack_require__(343);
|
||||||
const buildOptions = __webpack_require__(343).buildOptions;
|
const buildOptions = __webpack_require__(343).buildOptions;
|
||||||
const xmlNode = __webpack_require__(66);
|
const xmlNode = __webpack_require__(66);
|
||||||
const TagType = {OPENING: 1, CLOSING: 2, SELF: 3, CDATA: 4};
|
const regx =
|
||||||
let regx =
|
'<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
|
||||||
'<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|(([\\w:\\-._]*:)?([\\w:\\-._]+))([^>]*)>|((\\/)(([\\w:\\-._]*:)?([\\w:\\-._]+))\\s*>))([^<]*)';
|
.replace(/NAME/g, util.nameRegexp);
|
||||||
|
|
||||||
//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
|
//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
|
||||||
//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
|
//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
|
||||||
@ -4069,7 +4082,6 @@ const defaultOptions = {
|
|||||||
trimValues: true, //Trim string values of tag and attributes
|
trimValues: true, //Trim string values of tag and attributes
|
||||||
cdataTagName: false,
|
cdataTagName: false,
|
||||||
cdataPositionChar: '\\c',
|
cdataPositionChar: '\\c',
|
||||||
localeRange: '',
|
|
||||||
tagValueProcessor: function(a, tagName) {
|
tagValueProcessor: function(a, tagName) {
|
||||||
return a;
|
return a;
|
||||||
},
|
},
|
||||||
@ -4095,7 +4107,6 @@ const props = [
|
|||||||
'trimValues',
|
'trimValues',
|
||||||
'cdataTagName',
|
'cdataTagName',
|
||||||
'cdataPositionChar',
|
'cdataPositionChar',
|
||||||
'localeRange',
|
|
||||||
'tagValueProcessor',
|
'tagValueProcessor',
|
||||||
'attrValueProcessor',
|
'attrValueProcessor',
|
||||||
'parseTrueNumberOnly',
|
'parseTrueNumberOnly',
|
||||||
@ -4103,83 +4114,13 @@ const props = [
|
|||||||
];
|
];
|
||||||
exports.props = props;
|
exports.props = props;
|
||||||
|
|
||||||
const getTraversalObj = function(xmlData, options) {
|
/**
|
||||||
options = buildOptions(options, defaultOptions, props);
|
* Trim -> valueProcessor -> parse value
|
||||||
//xmlData = xmlData.replace(/\r?\n/g, " ");//make it single line
|
* @param {string} tagName
|
||||||
xmlData = xmlData.replace(/<!--[\s\S]*?-->/g, ''); //Remove comments
|
* @param {string} val
|
||||||
|
* @param {object} options
|
||||||
const xmlObj = new xmlNode('!xml');
|
*/
|
||||||
let currentNode = xmlObj;
|
function processTagValue(tagName, val, options) {
|
||||||
|
|
||||||
regx = regx.replace(/\[\\w/g, '[' + options.localeRange + '\\w');
|
|
||||||
const tagsRegx = new RegExp(regx, 'g');
|
|
||||||
let tag = tagsRegx.exec(xmlData);
|
|
||||||
let nextTag = tagsRegx.exec(xmlData);
|
|
||||||
while (tag) {
|
|
||||||
const tagType = checkForTagType(tag);
|
|
||||||
|
|
||||||
if (tagType === TagType.CLOSING) {
|
|
||||||
//add parsed data to parent node
|
|
||||||
if (currentNode.parent && tag[14]) {
|
|
||||||
currentNode.parent.val = util.getValue(currentNode.parent.val) + '' + processTagValue(tag, options, currentNode.parent.tagname);
|
|
||||||
}
|
|
||||||
if (options.stopNodes.length && options.stopNodes.includes(currentNode.tagname)) {
|
|
||||||
currentNode.child = []
|
|
||||||
if (currentNode.attrsMap == undefined) { currentNode.attrsMap = {}}
|
|
||||||
currentNode.val = xmlData.substr(currentNode.startIndex + 1, tag.index - currentNode.startIndex - 1)
|
|
||||||
}
|
|
||||||
currentNode = currentNode.parent;
|
|
||||||
} else if (tagType === TagType.CDATA) {
|
|
||||||
if (options.cdataTagName) {
|
|
||||||
//add cdata node
|
|
||||||
const childNode = new xmlNode(options.cdataTagName, currentNode, tag[3]);
|
|
||||||
childNode.attrsMap = buildAttributesMap(tag[8], options);
|
|
||||||
currentNode.addChild(childNode);
|
|
||||||
//for backtracking
|
|
||||||
currentNode.val = util.getValue(currentNode.val) + options.cdataPositionChar;
|
|
||||||
//add rest value to parent node
|
|
||||||
if (tag[14]) {
|
|
||||||
currentNode.val += processTagValue(tag, options);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currentNode.val = (currentNode.val || '') + (tag[3] || '') + processTagValue(tag, options);
|
|
||||||
}
|
|
||||||
} else if (tagType === TagType.SELF) {
|
|
||||||
if (currentNode && tag[14]) {
|
|
||||||
currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(tag, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
const childNode = new xmlNode(options.ignoreNameSpace ? tag[7] : tag[5], currentNode, '');
|
|
||||||
if (tag[8] && tag[8].length > 0) {
|
|
||||||
tag[8] = tag[8].substr(0, tag[8].length - 1);
|
|
||||||
}
|
|
||||||
childNode.attrsMap = buildAttributesMap(tag[8], options);
|
|
||||||
currentNode.addChild(childNode);
|
|
||||||
} else {
|
|
||||||
//TagType.OPENING
|
|
||||||
const childNode = new xmlNode(
|
|
||||||
options.ignoreNameSpace ? tag[7] : tag[5],
|
|
||||||
currentNode,
|
|
||||||
processTagValue(tag, options)
|
|
||||||
);
|
|
||||||
if (options.stopNodes.length && options.stopNodes.includes(childNode.tagname)) {
|
|
||||||
childNode.startIndex=tag.index + tag[1].length
|
|
||||||
}
|
|
||||||
childNode.attrsMap = buildAttributesMap(tag[8], options);
|
|
||||||
currentNode.addChild(childNode);
|
|
||||||
currentNode = childNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
tag = nextTag;
|
|
||||||
nextTag = tagsRegx.exec(xmlData);
|
|
||||||
}
|
|
||||||
|
|
||||||
return xmlObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
function processTagValue(parsedTags, options, parentTagName) {
|
|
||||||
const tagName = parsedTags[7] || parentTagName;
|
|
||||||
let val = parsedTags[14];
|
|
||||||
if (val) {
|
if (val) {
|
||||||
if (options.trimValues) {
|
if (options.trimValues) {
|
||||||
val = val.trim();
|
val = val.trim();
|
||||||
@ -4191,18 +4132,6 @@ function processTagValue(parsedTags, options, parentTagName) {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkForTagType(match) {
|
|
||||||
if (match[4] === ']]>') {
|
|
||||||
return TagType.CDATA;
|
|
||||||
} else if (match[10] === '/') {
|
|
||||||
return TagType.CLOSING;
|
|
||||||
} else if (typeof match[8] !== 'undefined' && match[8].substr(match[8].length - 1) === '/') {
|
|
||||||
return TagType.SELF;
|
|
||||||
} else {
|
|
||||||
return TagType.OPENING;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveNameSpace(tagname, options) {
|
function resolveNameSpace(tagname, options) {
|
||||||
if (options.ignoreNameSpace) {
|
if (options.ignoreNameSpace) {
|
||||||
const tags = tagname.split(':');
|
const tags = tagname.split(':');
|
||||||
@ -4228,7 +4157,7 @@ function parseValue(val, shouldParse, parseTrueNumberOnly) {
|
|||||||
parsed = Number.parseInt(val, 16);
|
parsed = Number.parseInt(val, 16);
|
||||||
} else if (val.indexOf('.') !== -1) {
|
} else if (val.indexOf('.') !== -1) {
|
||||||
parsed = Number.parseFloat(val);
|
parsed = Number.parseFloat(val);
|
||||||
val = val.replace(/0+$/,"");
|
val = val.replace(/\.?0+$/, "");
|
||||||
} else {
|
} else {
|
||||||
parsed = Number.parseInt(val, 10);
|
parsed = Number.parseInt(val, 10);
|
||||||
}
|
}
|
||||||
@ -4288,6 +4217,177 @@ function buildAttributesMap(attrStr, options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getTraversalObj = function(xmlData, options) {
|
||||||
|
xmlData = xmlData.replace(/(\r\n)|\n/, " ");
|
||||||
|
options = buildOptions(options, defaultOptions, props);
|
||||||
|
const xmlObj = new xmlNode('!xml');
|
||||||
|
let currentNode = xmlObj;
|
||||||
|
let textData = "";
|
||||||
|
|
||||||
|
//function match(xmlData){
|
||||||
|
for(let i=0; i< xmlData.length; i++){
|
||||||
|
const ch = xmlData[i];
|
||||||
|
if(ch === '<'){
|
||||||
|
if( xmlData[i+1] === '/') {//Closing Tag
|
||||||
|
const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.")
|
||||||
|
let tagName = xmlData.substring(i+2,closeIndex).trim();
|
||||||
|
|
||||||
|
if(options.ignoreNameSpace){
|
||||||
|
const colonIndex = tagName.indexOf(":");
|
||||||
|
if(colonIndex !== -1){
|
||||||
|
tagName = tagName.substr(colonIndex+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if (currentNode.parent) {
|
||||||
|
currentNode.parent.val = util.getValue(currentNode.parent.val) + '' + processTagValue2(tagName, textData , options);
|
||||||
|
} */
|
||||||
|
if(currentNode){
|
||||||
|
if(currentNode.val){
|
||||||
|
currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(tagName, textData , options);
|
||||||
|
}else{
|
||||||
|
currentNode.val = processTagValue(tagName, textData , options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.stopNodes.length && options.stopNodes.includes(currentNode.tagname)) {
|
||||||
|
currentNode.child = []
|
||||||
|
if (currentNode.attrsMap == undefined) { currentNode.attrsMap = {}}
|
||||||
|
currentNode.val = xmlData.substr(currentNode.startIndex + 1, i - currentNode.startIndex - 1)
|
||||||
|
}
|
||||||
|
currentNode = currentNode.parent;
|
||||||
|
textData = "";
|
||||||
|
i = closeIndex;
|
||||||
|
} else if( xmlData[i+1] === '?') {
|
||||||
|
i = findClosingIndex(xmlData, "?>", i, "Pi Tag is not closed.")
|
||||||
|
} else if(xmlData.substr(i + 1, 3) === '!--') {
|
||||||
|
i = findClosingIndex(xmlData, "-->", i, "Comment is not closed.")
|
||||||
|
} else if( xmlData.substr(i + 1, 2) === '!D') {
|
||||||
|
const closeIndex = findClosingIndex(xmlData, ">", i, "DOCTYPE is not closed.")
|
||||||
|
const tagExp = xmlData.substring(i, closeIndex);
|
||||||
|
if(tagExp.indexOf("[") >= 0){
|
||||||
|
i = xmlData.indexOf("]>", i) + 1;
|
||||||
|
}else{
|
||||||
|
i = closeIndex;
|
||||||
|
}
|
||||||
|
}else if(xmlData.substr(i + 1, 2) === '![') {
|
||||||
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2
|
||||||
|
const tagExp = xmlData.substring(i + 9,closeIndex);
|
||||||
|
|
||||||
|
//considerations
|
||||||
|
//1. CDATA will always have parent node
|
||||||
|
//2. A tag with CDATA is not a leaf node so it's value would be string type.
|
||||||
|
if(textData){
|
||||||
|
currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(currentNode.tagname, textData , options);
|
||||||
|
textData = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.cdataTagName) {
|
||||||
|
//add cdata node
|
||||||
|
const childNode = new xmlNode(options.cdataTagName, currentNode, tagExp);
|
||||||
|
currentNode.addChild(childNode);
|
||||||
|
//for backtracking
|
||||||
|
currentNode.val = util.getValue(currentNode.val) + options.cdataPositionChar;
|
||||||
|
//add rest value to parent node
|
||||||
|
if (tagExp) {
|
||||||
|
childNode.val = tagExp;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentNode.val = (currentNode.val || '') + (tagExp || '');
|
||||||
|
}
|
||||||
|
|
||||||
|
i = closeIndex + 2;
|
||||||
|
}else {//Opening tag
|
||||||
|
const result = closingIndexForOpeningTag(xmlData, i+1)
|
||||||
|
let tagExp = result.data;
|
||||||
|
const closeIndex = result.index;
|
||||||
|
const separatorIndex = tagExp.indexOf(" ");
|
||||||
|
let tagName = tagExp;
|
||||||
|
if(separatorIndex !== -1){
|
||||||
|
tagName = tagExp.substr(0, separatorIndex).trimRight();
|
||||||
|
tagExp = tagExp.substr(separatorIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(options.ignoreNameSpace){
|
||||||
|
const colonIndex = tagName.indexOf(":");
|
||||||
|
if(colonIndex !== -1){
|
||||||
|
tagName = tagName.substr(colonIndex+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//save text to parent node
|
||||||
|
if (currentNode && textData) {
|
||||||
|
if(currentNode.tagname !== '!xml'){
|
||||||
|
currentNode.val = util.getValue(currentNode.val) + '' + processTagValue( currentNode.tagname, textData, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){//selfClosing tag
|
||||||
|
|
||||||
|
if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
|
||||||
|
tagName = tagName.substr(0, tagName.length - 1);
|
||||||
|
tagExp = tagName;
|
||||||
|
}else{
|
||||||
|
tagExp = tagExp.substr(0, tagExp.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const childNode = new xmlNode(tagName, currentNode, '');
|
||||||
|
if(tagName !== tagExp){
|
||||||
|
childNode.attrsMap = buildAttributesMap(tagExp, options);
|
||||||
|
}
|
||||||
|
currentNode.addChild(childNode);
|
||||||
|
}else{//opening tag
|
||||||
|
|
||||||
|
const childNode = new xmlNode( tagName, currentNode );
|
||||||
|
if (options.stopNodes.length && options.stopNodes.includes(childNode.tagname)) {
|
||||||
|
childNode.startIndex=closeIndex;
|
||||||
|
}
|
||||||
|
if(tagName !== tagExp){
|
||||||
|
childNode.attrsMap = buildAttributesMap(tagExp, options);
|
||||||
|
}
|
||||||
|
currentNode.addChild(childNode);
|
||||||
|
currentNode = childNode;
|
||||||
|
}
|
||||||
|
textData = "";
|
||||||
|
i = closeIndex;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
textData += xmlData[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return xmlObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
function closingIndexForOpeningTag(data, i){
|
||||||
|
let attrBoundary;
|
||||||
|
let tagExp = "";
|
||||||
|
for (let index = i; index < data.length; index++) {
|
||||||
|
let ch = data[index];
|
||||||
|
if (attrBoundary) {
|
||||||
|
if (ch === attrBoundary) attrBoundary = "";//reset
|
||||||
|
} else if (ch === '"' || ch === "'") {
|
||||||
|
attrBoundary = ch;
|
||||||
|
} else if (ch === '>') {
|
||||||
|
return {
|
||||||
|
data: tagExp,
|
||||||
|
index: index
|
||||||
|
}
|
||||||
|
} else if (ch === '\t') {
|
||||||
|
ch = " "
|
||||||
|
}
|
||||||
|
tagExp += ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function findClosingIndex(xmlData, str, i, errMsg){
|
||||||
|
const closingIndex = xmlData.indexOf(str, i);
|
||||||
|
if(closingIndex === -1){
|
||||||
|
throw new Error(errMsg)
|
||||||
|
}else{
|
||||||
|
return closingIndex + str.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exports.getTraversalObj = getTraversalObj;
|
exports.getTraversalObj = getTraversalObj;
|
||||||
|
|
||||||
|
|
||||||
@ -4665,7 +4765,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -7333,6 +7433,11 @@ function hasLastPage (link) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
||||||
|
const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
||||||
|
const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'
|
||||||
|
const regexName = new RegExp('^' + nameRegexp + '$');
|
||||||
|
|
||||||
const getAllMatches = function(string, regex) {
|
const getAllMatches = function(string, regex) {
|
||||||
const matches = [];
|
const matches = [];
|
||||||
let match = regex.exec(string);
|
let match = regex.exec(string);
|
||||||
@ -7348,15 +7453,11 @@ const getAllMatches = function(string, regex) {
|
|||||||
return matches;
|
return matches;
|
||||||
};
|
};
|
||||||
|
|
||||||
const doesMatch = function(string, regex) {
|
const isName = function(string) {
|
||||||
const match = regex.exec(string);
|
const match = regexName.exec(string);
|
||||||
return !(match === null || typeof match === 'undefined');
|
return !(match === null || typeof match === 'undefined');
|
||||||
};
|
};
|
||||||
|
|
||||||
const doesNotMatch = function(string, regex) {
|
|
||||||
return !doesMatch(string, regex);
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.isExist = function(v) {
|
exports.isExist = function(v) {
|
||||||
return typeof v !== 'undefined';
|
return typeof v !== 'undefined';
|
||||||
};
|
};
|
||||||
@ -7414,9 +7515,9 @@ exports.buildOptions = function(options, defaultOptions, props) {
|
|||||||
return newOptions;
|
return newOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.doesMatch = doesMatch;
|
exports.isName = isName;
|
||||||
exports.doesNotMatch = doesNotMatch;
|
|
||||||
exports.getAllMatches = getAllMatches;
|
exports.getAllMatches = getAllMatches;
|
||||||
|
exports.nameRegexp = nameRegexp;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@ -7615,7 +7716,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -8888,14 +8989,28 @@ class Command {
|
|||||||
return cmdStr;
|
return cmdStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
|
* @param input input to sanitize into a string
|
||||||
|
*/
|
||||||
|
function toCommandValue(input) {
|
||||||
|
if (input === null || input === undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
else if (typeof input === 'string' || input instanceof String) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
return JSON.stringify(input);
|
||||||
|
}
|
||||||
|
exports.toCommandValue = toCommandValue;
|
||||||
function escapeData(s) {
|
function escapeData(s) {
|
||||||
return (s || '')
|
return toCommandValue(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A');
|
.replace(/\n/g, '%0A');
|
||||||
}
|
}
|
||||||
function escapeProperty(s) {
|
function escapeProperty(s) {
|
||||||
return (s || '')
|
return toCommandValue(s)
|
||||||
.replace(/%/g, '%25')
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A')
|
.replace(/\n/g, '%0A')
|
||||||
@ -9550,6 +9665,12 @@ function convertBody(buffer, headers) {
|
|||||||
// html4
|
// html4
|
||||||
if (!res && str) {
|
if (!res && str) {
|
||||||
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
|
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
|
||||||
|
if (!res) {
|
||||||
|
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
|
||||||
|
if (res) {
|
||||||
|
res.pop(); // drop last quote
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
res = /charset=(.*)/i.exec(res.pop());
|
res = /charset=(.*)/i.exec(res.pop());
|
||||||
@ -10557,7 +10678,7 @@ function fetch(url, opts) {
|
|||||||
// HTTP fetch step 5.5
|
// HTTP fetch step 5.5
|
||||||
switch (request.redirect) {
|
switch (request.redirect) {
|
||||||
case 'error':
|
case 'error':
|
||||||
reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||||
finalize();
|
finalize();
|
||||||
return;
|
return;
|
||||||
case 'manual':
|
case 'manual':
|
||||||
@ -10596,7 +10717,8 @@ function fetch(url, opts) {
|
|||||||
method: request.method,
|
method: request.method,
|
||||||
body: request.body,
|
body: request.body,
|
||||||
signal: request.signal,
|
signal: request.signal,
|
||||||
timeout: request.timeout
|
timeout: request.timeout,
|
||||||
|
size: request.size
|
||||||
};
|
};
|
||||||
|
|
||||||
// HTTP-redirect fetch step 9
|
// HTTP-redirect fetch step 9
|
||||||
@ -11141,11 +11263,13 @@ var ExitCode;
|
|||||||
/**
|
/**
|
||||||
* Sets env variable for this action and future actions in the job
|
* Sets env variable for this action and future actions in the job
|
||||||
* @param name the name of the variable to set
|
* @param name the name of the variable to set
|
||||||
* @param val the value of the variable
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function exportVariable(name, val) {
|
function exportVariable(name, val) {
|
||||||
process.env[name] = val;
|
const convertedVal = command_1.toCommandValue(val);
|
||||||
command_1.issueCommand('set-env', { name }, val);
|
process.env[name] = convertedVal;
|
||||||
|
command_1.issueCommand('set-env', { name }, convertedVal);
|
||||||
}
|
}
|
||||||
exports.exportVariable = exportVariable;
|
exports.exportVariable = exportVariable;
|
||||||
/**
|
/**
|
||||||
@ -11184,12 +11308,22 @@ exports.getInput = getInput;
|
|||||||
* Sets the value of an output.
|
* Sets the value of an output.
|
||||||
*
|
*
|
||||||
* @param name name of the output to set
|
* @param name name of the output to set
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
command_1.issueCommand('set-output', { name }, value);
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function setCommandEcho(enabled) {
|
||||||
|
command_1.issue('echo', enabled ? 'on' : 'off');
|
||||||
|
}
|
||||||
|
exports.setCommandEcho = setCommandEcho;
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Results
|
// Results
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@ -11206,6 +11340,13 @@ exports.setFailed = setFailed;
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Logging Commands
|
// Logging Commands
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
function isDebug() {
|
||||||
|
return process.env['RUNNER_DEBUG'] === '1';
|
||||||
|
}
|
||||||
|
exports.isDebug = isDebug;
|
||||||
/**
|
/**
|
||||||
* Writes debug message to user log
|
* Writes debug message to user log
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
@ -11216,18 +11357,18 @@ function debug(message) {
|
|||||||
exports.debug = debug;
|
exports.debug = debug;
|
||||||
/**
|
/**
|
||||||
* Adds an error issue
|
* Adds an error issue
|
||||||
* @param message error issue message
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
*/
|
*/
|
||||||
function error(message) {
|
function error(message) {
|
||||||
command_1.issue('error', message);
|
command_1.issue('error', message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.error = error;
|
exports.error = error;
|
||||||
/**
|
/**
|
||||||
* Adds an warning issue
|
* Adds an warning issue
|
||||||
* @param message warning issue message
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
*/
|
*/
|
||||||
function warning(message) {
|
function warning(message) {
|
||||||
command_1.issue('warning', message);
|
command_1.issue('warning', message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.warning = warning;
|
exports.warning = warning;
|
||||||
/**
|
/**
|
||||||
@ -11285,8 +11426,9 @@ exports.group = group;
|
|||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
*
|
*
|
||||||
* @param name name of the state to store
|
* @param name name of the state to store
|
||||||
* @param value value to store
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function saveState(name, value) {
|
function saveState(name, value) {
|
||||||
command_1.issueCommand('save-state', { name }, value);
|
command_1.issueCommand('save-state', { name }, value);
|
||||||
}
|
}
|
||||||
@ -16624,7 +16766,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -21323,10 +21465,9 @@ const util = __webpack_require__(343);
|
|||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
allowBooleanAttributes: false, //A tag can have attributes without any value
|
allowBooleanAttributes: false, //A tag can have attributes without any value
|
||||||
localeRange: 'a-zA-Z',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = ['allowBooleanAttributes', 'localeRange'];
|
const props = ['allowBooleanAttributes'];
|
||||||
|
|
||||||
//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g");
|
//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g");
|
||||||
exports.validate = function (xmlData, options) {
|
exports.validate = function (xmlData, options) {
|
||||||
@ -21335,12 +21476,6 @@ exports.validate = function (xmlData, options) {
|
|||||||
//xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line
|
//xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line
|
||||||
//xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag
|
//xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag
|
||||||
//xmlData = xmlData.replace(/(<!DOCTYPE[\s\w\"\.\/\-\:]+(\[.*\])*\s*>)/g,"");//Remove DOCTYPE
|
//xmlData = xmlData.replace(/(<!DOCTYPE[\s\w\"\.\/\-\:]+(\[.*\])*\s*>)/g,"");//Remove DOCTYPE
|
||||||
const localRangeRegex = new RegExp(`[${options.localeRange}]`);
|
|
||||||
|
|
||||||
if (localRangeRegex.test("<#$'\"\\\/:0")) {
|
|
||||||
return getErrorObject('InvalidOptions', 'Invalid localeRange', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const tags = [];
|
const tags = [];
|
||||||
let tagFound = false;
|
let tagFound = false;
|
||||||
|
|
||||||
@ -21351,8 +21486,7 @@ exports.validate = function (xmlData, options) {
|
|||||||
// check for byte order mark (BOM)
|
// check for byte order mark (BOM)
|
||||||
xmlData = xmlData.substr(1);
|
xmlData = xmlData.substr(1);
|
||||||
}
|
}
|
||||||
const regxAttrName = new RegExp(`^[${options.localeRange}_][${options.localeRange}0-9\\-\\.:]*$`);
|
|
||||||
const regxTagName = new RegExp(`^([${options.localeRange}_])[${options.localeRange}0-9\\.\\-_:]*$`);
|
|
||||||
for (let i = 0; i < xmlData.length; i++) {
|
for (let i = 0; i < xmlData.length; i++) {
|
||||||
if (xmlData[i] === '<') {
|
if (xmlData[i] === '<') {
|
||||||
//starting of tag
|
//starting of tag
|
||||||
@ -21376,15 +21510,12 @@ exports.validate = function (xmlData, options) {
|
|||||||
}
|
}
|
||||||
//read tagname
|
//read tagname
|
||||||
let tagName = '';
|
let tagName = '';
|
||||||
for (
|
for (; i < xmlData.length &&
|
||||||
;
|
|
||||||
i < xmlData.length &&
|
|
||||||
xmlData[i] !== '>' &&
|
xmlData[i] !== '>' &&
|
||||||
xmlData[i] !== ' ' &&
|
xmlData[i] !== ' ' &&
|
||||||
xmlData[i] !== '\t' &&
|
xmlData[i] !== '\t' &&
|
||||||
xmlData[i] !== '\n' &&
|
xmlData[i] !== '\n' &&
|
||||||
xmlData[i] !== '\r';
|
xmlData[i] !== '\r'; i++
|
||||||
i++
|
|
||||||
) {
|
) {
|
||||||
tagName += xmlData[i];
|
tagName += xmlData[i];
|
||||||
}
|
}
|
||||||
@ -21397,19 +21528,19 @@ exports.validate = function (xmlData, options) {
|
|||||||
//continue;
|
//continue;
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
if (!validateTagName(tagName, regxTagName)) {
|
if (!validateTagName(tagName)) {
|
||||||
let msg;
|
let msg;
|
||||||
if(tagName.trim().length === 0) {
|
if (tagName.trim().length === 0) {
|
||||||
msg = "There is an unnecessary space between tag name and backward slash '</ ..'.";
|
msg = "There is an unnecessary space between tag name and backward slash '</ ..'.";
|
||||||
}else{
|
} else {
|
||||||
msg = `Tag '${tagName}' is an invalid name.`;
|
msg = "Tag '"+tagName+"' is an invalid name.";
|
||||||
}
|
}
|
||||||
return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = readAttributeStr(xmlData, i);
|
const result = readAttributeStr(xmlData, i);
|
||||||
if (result === false) {
|
if (result === false) {
|
||||||
return getErrorObject('InvalidAttr', `Attributes for '${tagName}' have open quote.`, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i));
|
||||||
}
|
}
|
||||||
let attrStr = result.value;
|
let attrStr = result.value;
|
||||||
i = result.index;
|
i = result.index;
|
||||||
@ -21417,7 +21548,7 @@ exports.validate = function (xmlData, options) {
|
|||||||
if (attrStr[attrStr.length - 1] === '/') {
|
if (attrStr[attrStr.length - 1] === '/') {
|
||||||
//self closing tag
|
//self closing tag
|
||||||
attrStr = attrStr.substring(0, attrStr.length - 1);
|
attrStr = attrStr.substring(0, attrStr.length - 1);
|
||||||
const isValid = validateAttributeString(attrStr, options, regxAttrName);
|
const isValid = validateAttributeString(attrStr, options);
|
||||||
if (isValid === true) {
|
if (isValid === true) {
|
||||||
tagFound = true;
|
tagFound = true;
|
||||||
//continue; //text may presents after self closing tag
|
//continue; //text may presents after self closing tag
|
||||||
@ -21429,23 +21560,22 @@ exports.validate = function (xmlData, options) {
|
|||||||
}
|
}
|
||||||
} else if (closingTag) {
|
} else if (closingTag) {
|
||||||
if (!result.tagClosed) {
|
if (!result.tagClosed) {
|
||||||
return getErrorObject('InvalidTag', `Closing tag '${tagName}' doesn't have proper closing.`, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
|
||||||
} else if (attrStr.trim().length > 0) {
|
} else if (attrStr.trim().length > 0) {
|
||||||
return getErrorObject('InvalidTag', `Closing tag '${tagName}' can't have attributes or invalid starting.`, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, i));
|
||||||
} else {
|
} else {
|
||||||
const otg = tags.pop();
|
const otg = tags.pop();
|
||||||
if (tagName !== otg) {
|
if (tagName !== otg) {
|
||||||
return getErrorObject('InvalidTag', `Closing tag '${otg}' is expected inplace of '${tagName}'.`, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidTag', "Closing tag '"+otg+"' is expected inplace of '"+tagName+"'.", getLineNumberForPosition(xmlData, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//when there are no more tags, we reached the root level.
|
//when there are no more tags, we reached the root level.
|
||||||
if(tags.length == 0)
|
if (tags.length == 0) {
|
||||||
{
|
|
||||||
reachedRoot = true;
|
reachedRoot = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const isValid = validateAttributeString(attrStr, options, regxAttrName);
|
const isValid = validateAttributeString(attrStr, options);
|
||||||
if (isValid !== true) {
|
if (isValid !== true) {
|
||||||
//the result from the nested function returns the position of the error within the attribute
|
//the result from the nested function returns the position of the error within the attribute
|
||||||
//in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute
|
//in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute
|
||||||
@ -21454,7 +21584,7 @@ exports.validate = function (xmlData, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if the root level has been reached before ...
|
//if the root level has been reached before ...
|
||||||
if(reachedRoot === true) {
|
if (reachedRoot === true) {
|
||||||
return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));
|
||||||
} else {
|
} else {
|
||||||
tags.push(tagName);
|
tags.push(tagName);
|
||||||
@ -21474,6 +21604,11 @@ exports.validate = function (xmlData, options) {
|
|||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (xmlData[i] === '&') {
|
||||||
|
const afterAmp = validateAmpersand(xmlData, i);
|
||||||
|
if (afterAmp == -1)
|
||||||
|
return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
|
||||||
|
i = afterAmp;
|
||||||
}
|
}
|
||||||
} //end of reading tag text value
|
} //end of reading tag text value
|
||||||
if (xmlData[i] === '<') {
|
if (xmlData[i] === '<') {
|
||||||
@ -21484,14 +21619,14 @@ exports.validate = function (xmlData, options) {
|
|||||||
if (xmlData[i] === ' ' || xmlData[i] === '\t' || xmlData[i] === '\n' || xmlData[i] === '\r') {
|
if (xmlData[i] === ' ' || xmlData[i] === '\t' || xmlData[i] === '\n' || xmlData[i] === '\r') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return getErrorObject('InvalidChar', `char '${xmlData[i]}' is not expected.`, getLineNumberForPosition(xmlData, i));
|
return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tagFound) {
|
if (!tagFound) {
|
||||||
return getErrorObject('InvalidXml', 'Start tag expected.', 1);
|
return getErrorObject('InvalidXml', 'Start tag expected.', 1);
|
||||||
} else if (tags.length > 0) {
|
} else if (tags.length > 0) {
|
||||||
return getErrorObject('InvalidXml', `Invalid '${JSON.stringify(tags, null, 4).replace(/\r?\n/g, '')}' found.`, 1);
|
return getErrorObject('InvalidXml', "Invalid '"+JSON.stringify(tags, null, 4).replace(/\r?\n/g, '')+"' found.", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -21607,7 +21742,11 @@ function readAttributeStr(xmlData, i) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { value: attrStr, index: i, tagClosed: tagClosed };
|
return {
|
||||||
|
value: attrStr,
|
||||||
|
index: i,
|
||||||
|
tagClosed: tagClosed
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21617,7 +21756,7 @@ const validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s
|
|||||||
|
|
||||||
//attr, ="sd", a="amit's", a="sd"b="saf", ab cd=""
|
//attr, ="sd", a="amit's", a="sd"b="saf", ab cd=""
|
||||||
|
|
||||||
function validateAttributeString(attrStr, options, regxAttrName) {
|
function validateAttributeString(attrStr, options) {
|
||||||
//console.log("start:"+attrStr+":end");
|
//console.log("start:"+attrStr+":end");
|
||||||
|
|
||||||
//if(attrStr.trim().length === 0) return true; //empty string
|
//if(attrStr.trim().length === 0) return true; //empty string
|
||||||
@ -21628,29 +21767,64 @@ function validateAttributeString(attrStr, options, regxAttrName) {
|
|||||||
for (let i = 0; i < matches.length; i++) {
|
for (let i = 0; i < matches.length; i++) {
|
||||||
if (matches[i][1].length === 0) {
|
if (matches[i][1].length === 0) {
|
||||||
//nospace before attribute name: a="sd"b="saf"
|
//nospace before attribute name: a="sd"b="saf"
|
||||||
return getErrorObject('InvalidAttr', `Attribute '${matches[i][2]}' has no space in starting.`, getPositionFromMatch(attrStr, matches[i][0]))
|
return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(attrStr, matches[i][0]))
|
||||||
} else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {
|
} else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {
|
||||||
//independent attribute: ab
|
//independent attribute: ab
|
||||||
return getErrorObject('InvalidAttr', `boolean attribute '${matches[i][2]}' is not allowed.`, getPositionFromMatch(attrStr, matches[i][0]));
|
return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(attrStr, matches[i][0]));
|
||||||
}
|
}
|
||||||
/* else if(matches[i][6] === undefined){//attribute without value: ab=
|
/* else if(matches[i][6] === undefined){//attribute without value: ab=
|
||||||
return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}};
|
return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}};
|
||||||
} */
|
} */
|
||||||
const attrName = matches[i][2];
|
const attrName = matches[i][2];
|
||||||
if (!validateAttrName(attrName, regxAttrName)) {
|
if (!validateAttrName(attrName)) {
|
||||||
return getErrorObject('InvalidAttr', `Attribute '${attrName}' is an invalid name.`, getPositionFromMatch(attrStr, matches[i][0]));
|
return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(attrStr, matches[i][0]));
|
||||||
}
|
}
|
||||||
if (!attrNames.hasOwnProperty(attrName)) {
|
if (!attrNames.hasOwnProperty(attrName)) {
|
||||||
//check for duplicate attribute.
|
//check for duplicate attribute.
|
||||||
attrNames[attrName] = 1;
|
attrNames[attrName] = 1;
|
||||||
} else {
|
} else {
|
||||||
return getErrorObject('InvalidAttr', `Attribute '${attrName}' is repeated.`, getPositionFromMatch(attrStr, matches[i][0]));
|
return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(attrStr, matches[i][0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateNumberAmpersand(xmlData, i) {
|
||||||
|
let re = /\d/;
|
||||||
|
if (xmlData[i] === 'x') {
|
||||||
|
i++;
|
||||||
|
re = /[\da-fA-F]/;
|
||||||
|
}
|
||||||
|
for (; i < xmlData.length; i++) {
|
||||||
|
if (xmlData[i] === ';')
|
||||||
|
return i;
|
||||||
|
if (!xmlData[i].match(re))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateAmpersand(xmlData, i) {
|
||||||
|
// https://www.w3.org/TR/xml/#dt-charref
|
||||||
|
i++;
|
||||||
|
if (xmlData[i] === ';')
|
||||||
|
return -1;
|
||||||
|
if (xmlData[i] === '#') {
|
||||||
|
i++;
|
||||||
|
return validateNumberAmpersand(xmlData, i);
|
||||||
|
}
|
||||||
|
let count = 0;
|
||||||
|
for (; i < xmlData.length; i++, count++) {
|
||||||
|
if (xmlData[i].match(/\w/) && count < 20)
|
||||||
|
continue;
|
||||||
|
if (xmlData[i] === ';')
|
||||||
|
break;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
function getErrorObject(code, message, lineNumber) {
|
function getErrorObject(code, message, lineNumber) {
|
||||||
return {
|
return {
|
||||||
err: {
|
err: {
|
||||||
@ -21661,19 +21835,14 @@ function getErrorObject(code, message, lineNumber) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateAttrName(attrName, regxAttrName) {
|
function validateAttrName(attrName) {
|
||||||
// const validAttrRegxp = new RegExp(regxAttrName);
|
return util.isName(attrName);
|
||||||
return util.doesMatch(attrName, regxAttrName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//const startsWithXML = new RegExp("^[Xx][Mm][Ll]");
|
// const startsWithXML = /^xml/i;
|
||||||
// startsWith = /^([a-zA-Z]|_)[\w.\-_:]*/;
|
|
||||||
|
|
||||||
function validateTagName(tagname, regxTagName) {
|
function validateTagName(tagname) {
|
||||||
/*if(util.doesMatch(tagname,startsWithXML)) return false;
|
return util.isName(tagname) /* && !tagname.match(startsWithXML) */;
|
||||||
else*/
|
|
||||||
//return !tagname.toLowerCase().startsWith("xml") || !util.doesNotMatch(tagname, regxTagName);
|
|
||||||
return !util.doesNotMatch(tagname, regxTagName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//this function returns the line number for the character at the given index
|
//this function returns the line number for the character at the given index
|
||||||
@ -21687,6 +21856,7 @@ function getPositionFromMatch(attrStr, match) {
|
|||||||
return attrStr.indexOf(match) + match.length;
|
return attrStr.indexOf(match) + match.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 986:
|
/***/ 986:
|
||||||
@ -21703,8 +21873,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const tr = __webpack_require__(9);
|
const tr = __importStar(__webpack_require__(9));
|
||||||
/**
|
/**
|
||||||
* Exec a command.
|
* Exec a command.
|
||||||
* Output will be streamed to the live console.
|
* Output will be streamed to the live console.
|
||||||
@ -21755,7 +21932,9 @@ exports.parse = function(xmlData, options, validationOption) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props);
|
options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props);
|
||||||
return nodeToJson.convertToJson(xmlToNodeobj.getTraversalObj(xmlData, options), options);
|
const traversableObj = xmlToNodeobj.getTraversalObj(xmlData, options)
|
||||||
|
//print(traversableObj, " ");
|
||||||
|
return nodeToJson.convertToJson(traversableObj, options);
|
||||||
};
|
};
|
||||||
exports.convertTonimn = __webpack_require__(961).convert2nimn;
|
exports.convertTonimn = __webpack_require__(961).convert2nimn;
|
||||||
exports.getTraversalObj = xmlToNodeobj.getTraversalObj;
|
exports.getTraversalObj = xmlToNodeobj.getTraversalObj;
|
||||||
@ -21768,6 +21947,41 @@ exports.parseToNimn = function(xmlData, schema, options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function print(xmlNode, indentation){
|
||||||
|
if(xmlNode){
|
||||||
|
console.log(indentation + "{")
|
||||||
|
console.log(indentation + " \"tagName\": \"" + xmlNode.tagname + "\", ");
|
||||||
|
if(xmlNode.parent){
|
||||||
|
console.log(indentation + " \"parent\": \"" + xmlNode.parent.tagname + "\", ");
|
||||||
|
}
|
||||||
|
console.log(indentation + " \"val\": \"" + xmlNode.val + "\", ");
|
||||||
|
console.log(indentation + " \"attrs\": " + JSON.stringify(xmlNode.attrsMap,null,4) + ", ");
|
||||||
|
|
||||||
|
if(xmlNode.child){
|
||||||
|
console.log(indentation + "\"child\": {")
|
||||||
|
const indentation2 = indentation + indentation;
|
||||||
|
Object.keys(xmlNode.child).forEach( function(key) {
|
||||||
|
const node = xmlNode.child[key];
|
||||||
|
|
||||||
|
if(Array.isArray(node)){
|
||||||
|
console.log(indentation + "\""+key+"\" :[")
|
||||||
|
node.forEach( function(item,index) {
|
||||||
|
//console.log(indentation + " \""+index+"\" : [")
|
||||||
|
print(item, indentation2);
|
||||||
|
})
|
||||||
|
console.log(indentation + "],")
|
||||||
|
}else{
|
||||||
|
console.log(indentation + " \""+key+"\" : {")
|
||||||
|
print(node, indentation2);
|
||||||
|
console.log(indentation + "},")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(indentation + "},")
|
||||||
|
}
|
||||||
|
console.log(indentation + "},")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
/******/ });
|
/******/ });
|
1407
package-lock.json
generated
1407
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -30,8 +30,8 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.2",
|
"@actions/core": "^1.2.5",
|
||||||
"@actions/exec": "^1.0.3",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/github": "^1.1.0",
|
"@actions/github": "^1.1.0",
|
||||||
"@actions/http-client": "^1.0.8",
|
"@actions/http-client": "^1.0.8",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
@ -41,15 +41,15 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^25.2.3",
|
"@types/jest": "^25.2.3",
|
||||||
"@types/node": "^12.12.42",
|
"@types/node": "^12.12.62",
|
||||||
"@types/semver": "^6.0.0",
|
"@types/semver": "^6.2.2",
|
||||||
"@zeit/ncc": "^0.21.0",
|
"@zeit/ncc": "^0.21.1",
|
||||||
"husky": "^4.2.5",
|
"husky": "^4.3.0",
|
||||||
"jest": "^26.0.1",
|
"jest": "^26.4.2",
|
||||||
"jest-circus": "^26.0.1",
|
"jest-circus": "^26.4.2",
|
||||||
"prettier": "^1.17.1",
|
"prettier": "^1.19.1",
|
||||||
"ts-jest": "^26.0.0",
|
"ts-jest": "^26.4.0",
|
||||||
"typescript": "^3.9.3",
|
"typescript": "^3.9.7",
|
||||||
"wget-improved": "^3.2.1"
|
"wget-improved": "^3.2.1"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
Loading…
Reference in New Issue
Block a user