Skip to content

Commit 5fcf01e

Browse files
Merge pull request #896 from actions-rs-plus/lock-file-maintenance-895
chore(deps): rebuilding because of lock file maintenance
2 parents cd4fed5 + 252ca6b commit 5fcf01e

File tree

3 files changed

+120
-81
lines changed

3 files changed

+120
-81
lines changed

dist/index.js

+46-12
Original file line numberDiff line numberDiff line change
@@ -41244,6 +41244,32 @@ module.exports = {
4124441244

4124541245
/***/ }),
4124641246

41247+
/***/ 4958:
41248+
/***/ ((module) => {
41249+
41250+
function getIgnoreAttributesFn(ignoreAttributes) {
41251+
if (typeof ignoreAttributes === 'function') {
41252+
return ignoreAttributes
41253+
}
41254+
if (Array.isArray(ignoreAttributes)) {
41255+
return (attrName) => {
41256+
for (const pattern of ignoreAttributes) {
41257+
if (typeof pattern === 'string' && attrName === pattern) {
41258+
return true
41259+
}
41260+
if (pattern instanceof RegExp && pattern.test(attrName)) {
41261+
return true
41262+
}
41263+
}
41264+
}
41265+
}
41266+
return () => false
41267+
}
41268+
41269+
module.exports = getIgnoreAttributesFn
41270+
41271+
/***/ }),
41272+
4124741273
/***/ 8280:
4124841274
/***/ ((__unused_webpack_module, exports) => {
4124941275

@@ -41761,6 +41787,7 @@ function getPositionFromMatch(match) {
4176141787

4176241788
//parse Empty Node as self closing node
4176341789
const buildFromOrderedJs = __nccwpck_require__(2462);
41790+
const getIgnoreAttributesFn = __nccwpck_require__(4958)
4176441791

4176541792
const defaultOptions = {
4176641793
attributeNamePrefix: '@_',
@@ -41798,11 +41825,12 @@ const defaultOptions = {
4179841825

4179941826
function Builder(options) {
4180041827
this.options = Object.assign({}, defaultOptions, options);
41801-
if (this.options.ignoreAttributes || this.options.attributesGroupName) {
41828+
if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
4180241829
this.isAttribute = function(/*a*/) {
4180341830
return false;
4180441831
};
4180541832
} else {
41833+
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
4180641834
this.attrPrefixLen = this.options.attributeNamePrefix.length;
4180741835
this.isAttribute = isAttribute;
4180841836
}
@@ -41831,13 +41859,14 @@ Builder.prototype.build = function(jObj) {
4183141859
[this.options.arrayNodeName] : jObj
4183241860
}
4183341861
}
41834-
return this.j2x(jObj, 0).val;
41862+
return this.j2x(jObj, 0, []).val;
4183541863
}
4183641864
};
4183741865

41838-
Builder.prototype.j2x = function(jObj, level) {
41866+
Builder.prototype.j2x = function(jObj, level, ajPath) {
4183941867
let attrStr = '';
4184041868
let val = '';
41869+
const jPath = ajPath.join('.')
4184141870
for (let key in jObj) {
4184241871
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
4184341872
if (typeof jObj[key] === 'undefined') {
@@ -41860,9 +41889,9 @@ Builder.prototype.j2x = function(jObj, level) {
4186041889
} else if (typeof jObj[key] !== 'object') {
4186141890
//premitive type
4186241891
const attr = this.isAttribute(key);
41863-
if (attr) {
41892+
if (attr && !this.ignoreAttributesFn(attr, jPath)) {
4186441893
attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);
41865-
}else {
41894+
} else if (!attr) {
4186641895
//tag value
4186741896
if (key === this.options.textNodeName) {
4186841897
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
@@ -41886,13 +41915,13 @@ Builder.prototype.j2x = function(jObj, level) {
4188641915
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
4188741916
} else if (typeof item === 'object') {
4188841917
if(this.options.oneListGroup){
41889-
const result = this.j2x(item, level + 1);
41918+
const result = this.j2x(item, level + 1, ajPath.concat(key));
4189041919
listTagVal += result.val;
4189141920
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
4189241921
listTagAttr += result.attrStr
4189341922
}
4189441923
}else{
41895-
listTagVal += this.processTextOrObjNode(item, key, level)
41924+
listTagVal += this.processTextOrObjNode(item, key, level, ajPath)
4189641925
}
4189741926
} else {
4189841927
if (this.options.oneListGroup) {
@@ -41917,7 +41946,7 @@ Builder.prototype.j2x = function(jObj, level) {
4191741946
attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);
4191841947
}
4191941948
} else {
41920-
val += this.processTextOrObjNode(jObj[key], key, level)
41949+
val += this.processTextOrObjNode(jObj[key], key, level, ajPath)
4192141950
}
4192241951
}
4192341952
}
@@ -41932,8 +41961,8 @@ Builder.prototype.buildAttrPairStr = function(attrName, val){
4193241961
} else return ' ' + attrName + '="' + val + '"';
4193341962
}
4193441963

41935-
function processTextOrObjNode (object, key, level) {
41936-
const result = this.j2x(object, level + 1);
41964+
function processTextOrObjNode (object, key, level, ajPath) {
41965+
const result = this.j2x(object, level + 1, ajPath.concat(key));
4193741966
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
4193841967
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
4193941968
} else {
@@ -42408,6 +42437,7 @@ const util = __nccwpck_require__(8280);
4240842437
const xmlNode = __nccwpck_require__(7462);
4240942438
const readDocType = __nccwpck_require__(6072);
4241042439
const toNumber = __nccwpck_require__(4526);
42440+
const getIgnoreAttributesFn = __nccwpck_require__(4958)
4241142441

4241242442
// const regx =
4241342443
// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
@@ -42456,6 +42486,7 @@ class OrderedObjParser{
4245642486
this.readStopNodeData = readStopNodeData;
4245742487
this.saveTextToParentTag = saveTextToParentTag;
4245842488
this.addChild = addChild;
42489+
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
4245942490
}
4246042491

4246142492
}
@@ -42528,7 +42559,7 @@ function resolveNameSpace(tagname) {
4252842559
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
4252942560

4253042561
function buildAttributesMap(attrStr, jPath, tagName) {
42531-
if (!this.options.ignoreAttributes && typeof attrStr === 'string') {
42562+
if (this.options.ignoreAttributes !== true && typeof attrStr === 'string') {
4253242563
// attrStr = attrStr.replace(/\r?\n/g, ' ');
4253342564
//attrStr = attrStr || attrStr.trim();
4253442565

@@ -42537,6 +42568,9 @@ function buildAttributesMap(attrStr, jPath, tagName) {
4253742568
const attrs = {};
4253842569
for (let i = 0; i < len; i++) {
4253942570
const attrName = this.resolveNameSpace(matches[i][1]);
42571+
if (this.ignoreAttributesFn(attrName, jPath)) {
42572+
continue
42573+
}
4254042574
let oldVal = matches[i][4];
4254142575
let aName = this.options.attributeNamePrefix + attrName;
4254242576
if (attrName.length) {
@@ -44660,7 +44694,7 @@ var y = d * 365.25;
4466044694
* @api public
4466144695
*/
4466244696

44663-
module.exports = function(val, options) {
44697+
module.exports = function (val, options) {
4466444698
options = options || {};
4466544699
var type = typeof val;
4466644700
if (type === 'string' && val.length > 0) {

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)