@ts-for-gir/cli 4.0.0-beta.37 → 4.0.0-beta.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/ts-for-gir CHANGED
@@ -29,12 +29,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../.yarn/cache/lodash-npm-4.17.21-6382451519-c08619c038.zip/node_modules/lodash/lodash.js
32
+ // ../../.yarn/cache/lodash-npm-4.17.23-50bdb1c01a-82504c8825.zip/node_modules/lodash/lodash.js
33
33
  var require_lodash = __commonJS({
34
- "../../.yarn/cache/lodash-npm-4.17.21-6382451519-c08619c038.zip/node_modules/lodash/lodash.js"(exports2, module) {
34
+ "../../.yarn/cache/lodash-npm-4.17.23-50bdb1c01a-82504c8825.zip/node_modules/lodash/lodash.js"(exports2, module) {
35
35
  (function() {
36
36
  var undefined2;
37
- var VERSION = "4.17.21";
37
+ var VERSION = "4.17.23";
38
38
  var LARGE_ARRAY_SIZE = 200;
39
39
  var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
40
40
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
@@ -1962,8 +1962,28 @@ var require_lodash = __commonJS({
1962
1962
  }
1963
1963
  function baseUnset(object, path) {
1964
1964
  path = castPath(path, object);
1965
- object = parent(object, path);
1966
- return object == null || delete object[toKey(last(path))];
1965
+ var index = -1, length = path.length;
1966
+ if (!length) {
1967
+ return true;
1968
+ }
1969
+ var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
1970
+ while (++index < length) {
1971
+ var key = path[index];
1972
+ if (typeof key !== "string") {
1973
+ continue;
1974
+ }
1975
+ if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
1976
+ return false;
1977
+ }
1978
+ if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
1979
+ if (isRootPrimitive && index === 0) {
1980
+ continue;
1981
+ }
1982
+ return false;
1983
+ }
1984
+ }
1985
+ var obj = parent(object, path);
1986
+ return obj == null || delete obj[toKey(last(path))];
1967
1987
  }
1968
1988
  function baseUpdate(object, path, updater, customizer) {
1969
1989
  return baseSet(object, path, updater(baseGet(object, path)), customizer);
@@ -4127,7 +4147,7 @@ var require_lodash = __commonJS({
4127
4147
  var tag = baseGetTag(value);
4128
4148
  return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
4129
4149
  }
4130
- function isFinite(value) {
4150
+ function isFinite2(value) {
4131
4151
  return typeof value == "number" && nativeIsFinite(value);
4132
4152
  }
4133
4153
  function isFunction(value) {
@@ -5228,7 +5248,7 @@ var require_lodash = __commonJS({
5228
5248
  lodash2.isEqual = isEqual2;
5229
5249
  lodash2.isEqualWith = isEqualWith;
5230
5250
  lodash2.isError = isError;
5231
- lodash2.isFinite = isFinite;
5251
+ lodash2.isFinite = isFinite2;
5232
5252
  lodash2.isFunction = isFunction;
5233
5253
  lodash2.isInteger = isInteger;
5234
5254
  lodash2.isLength = isLength;
@@ -6576,7 +6596,7 @@ __export(parser_exports, {
6576
6596
  parseGir: () => parseGir
6577
6597
  });
6578
6598
 
6579
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/util.js
6599
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/util.js
6580
6600
  var 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";
6581
6601
  var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
6582
6602
  var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
@@ -6604,7 +6624,7 @@ function isExist(v) {
6604
6624
  return typeof v !== "undefined";
6605
6625
  }
6606
6626
 
6607
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/validator.js
6627
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/validator.js
6608
6628
  var defaultOptions = {
6609
6629
  allowBooleanAttributes: false,
6610
6630
  //A tag can have attributes without any value
@@ -6842,7 +6862,7 @@ function validateAttributeString(attrStr, options2) {
6842
6862
  if (!validateAttrName(attrName)) {
6843
6863
  return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i]));
6844
6864
  }
6845
- if (!attrNames.hasOwnProperty(attrName)) {
6865
+ if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) {
6846
6866
  attrNames[attrName] = 1;
6847
6867
  } else {
6848
6868
  return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i]));
@@ -6910,7 +6930,7 @@ function getPositionFromMatch(match) {
6910
6930
  return match.startIndex + match[1].length;
6911
6931
  }
6912
6932
 
6913
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
6933
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
6914
6934
  var defaultOptions2 = {
6915
6935
  preserveOrder: false,
6916
6936
  attributeNamePrefix: "@_",
@@ -6954,24 +6974,55 @@ var defaultOptions2 = {
6954
6974
  return tagName;
6955
6975
  },
6956
6976
  // skipEmptyListItem: false
6957
- captureMetaData: false
6977
+ captureMetaData: false,
6978
+ maxNestedTags: 100,
6979
+ strictReservedNames: true
6958
6980
  };
6981
+ function normalizeProcessEntities(value) {
6982
+ if (typeof value === "boolean") {
6983
+ return {
6984
+ enabled: value,
6985
+ // true or false
6986
+ maxEntitySize: 1e4,
6987
+ maxExpansionDepth: 10,
6988
+ maxTotalExpansions: 1e3,
6989
+ maxExpandedLength: 1e5,
6990
+ allowedTags: null,
6991
+ tagFilter: null
6992
+ };
6993
+ }
6994
+ if (typeof value === "object" && value !== null) {
6995
+ return {
6996
+ enabled: value.enabled !== false,
6997
+ // default true if not specified
6998
+ maxEntitySize: value.maxEntitySize ?? 1e4,
6999
+ maxExpansionDepth: value.maxExpansionDepth ?? 10,
7000
+ maxTotalExpansions: value.maxTotalExpansions ?? 1e3,
7001
+ maxExpandedLength: value.maxExpandedLength ?? 1e5,
7002
+ allowedTags: value.allowedTags ?? null,
7003
+ tagFilter: value.tagFilter ?? null
7004
+ };
7005
+ }
7006
+ return normalizeProcessEntities(true);
7007
+ }
6959
7008
  var buildOptions = function(options2) {
6960
- return Object.assign({}, defaultOptions2, options2);
7009
+ const built = Object.assign({}, defaultOptions2, options2);
7010
+ built.processEntities = normalizeProcessEntities(built.processEntities);
7011
+ return built;
6961
7012
  };
6962
7013
 
6963
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
7014
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
6964
7015
  var METADATA_SYMBOL;
6965
7016
  if (typeof Symbol !== "function") {
6966
7017
  METADATA_SYMBOL = "@@xmlMetadata";
6967
7018
  } else {
6968
- METADATA_SYMBOL = Symbol("XML Node Metadata");
7019
+ METADATA_SYMBOL = /* @__PURE__ */ Symbol("XML Node Metadata");
6969
7020
  }
6970
7021
  var XmlNode = class {
6971
7022
  constructor(tagname) {
6972
7023
  this.tagname = tagname;
6973
7024
  this.child = [];
6974
- this[":@"] = {};
7025
+ this[":@"] = /* @__PURE__ */ Object.create(null);
6975
7026
  }
6976
7027
  add(key, val) {
6977
7028
  if (key === "__proto__") key = "#__proto__";
@@ -6994,170 +7045,263 @@ var XmlNode = class {
6994
7045
  }
6995
7046
  };
6996
7047
 
6997
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
6998
- function readDocType(xmlData, i) {
6999
- const entities = {};
7000
- if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") {
7001
- i = i + 9;
7002
- let angleBracketsCount = 1;
7003
- let hasBody = false, comment = false;
7004
- let exp = "";
7005
- for (; i < xmlData.length; i++) {
7006
- if (xmlData[i] === "<" && !comment) {
7007
- if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
7008
- i += 7;
7009
- let entityName, val;
7010
- [entityName, val, i] = readEntityExp(xmlData, i + 1);
7011
- if (val.indexOf("&") === -1)
7012
- entities[entityName] = {
7013
- regx: RegExp(`&${entityName};`, "g"),
7014
- val
7015
- };
7016
- } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) {
7017
- i += 8;
7018
- const { index } = readElementExp(xmlData, i + 1);
7019
- i = index;
7020
- } else if (hasBody && hasSeq(xmlData, "!ATTLIST", i)) {
7021
- i += 8;
7022
- } else if (hasBody && hasSeq(xmlData, "!NOTATION", i)) {
7023
- i += 9;
7024
- const { index } = readNotationExp(xmlData, i + 1);
7025
- i = index;
7026
- } else if (hasSeq(xmlData, "!--", i)) comment = true;
7027
- else throw new Error(`Invalid DOCTYPE`);
7028
- angleBracketsCount++;
7029
- exp = "";
7030
- } else if (xmlData[i] === ">") {
7031
- if (comment) {
7032
- if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") {
7033
- comment = false;
7048
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
7049
+ var DocTypeReader = class {
7050
+ constructor(options2) {
7051
+ this.suppressValidationErr = !options2;
7052
+ this.options = options2;
7053
+ }
7054
+ readDocType(xmlData, i) {
7055
+ const entities = /* @__PURE__ */ Object.create(null);
7056
+ if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") {
7057
+ i = i + 9;
7058
+ let angleBracketsCount = 1;
7059
+ let hasBody = false, comment = false;
7060
+ let exp = "";
7061
+ for (; i < xmlData.length; i++) {
7062
+ if (xmlData[i] === "<" && !comment) {
7063
+ if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
7064
+ i += 7;
7065
+ let entityName, val;
7066
+ [entityName, val, i] = this.readEntityExp(xmlData, i + 1, this.suppressValidationErr);
7067
+ if (val.indexOf("&") === -1) {
7068
+ const escaped = entityName.replace(/[.\-+*:]/g, "\\.");
7069
+ entities[entityName] = {
7070
+ regx: RegExp(`&${escaped};`, "g"),
7071
+ val
7072
+ };
7073
+ }
7074
+ } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) {
7075
+ i += 8;
7076
+ const { index } = this.readElementExp(xmlData, i + 1);
7077
+ i = index;
7078
+ } else if (hasBody && hasSeq(xmlData, "!ATTLIST", i)) {
7079
+ i += 8;
7080
+ } else if (hasBody && hasSeq(xmlData, "!NOTATION", i)) {
7081
+ i += 9;
7082
+ const { index } = this.readNotationExp(xmlData, i + 1, this.suppressValidationErr);
7083
+ i = index;
7084
+ } else if (hasSeq(xmlData, "!--", i)) comment = true;
7085
+ else throw new Error(`Invalid DOCTYPE`);
7086
+ angleBracketsCount++;
7087
+ exp = "";
7088
+ } else if (xmlData[i] === ">") {
7089
+ if (comment) {
7090
+ if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") {
7091
+ comment = false;
7092
+ angleBracketsCount--;
7093
+ }
7094
+ } else {
7034
7095
  angleBracketsCount--;
7035
7096
  }
7097
+ if (angleBracketsCount === 0) {
7098
+ break;
7099
+ }
7100
+ } else if (xmlData[i] === "[") {
7101
+ hasBody = true;
7036
7102
  } else {
7037
- angleBracketsCount--;
7038
- }
7039
- if (angleBracketsCount === 0) {
7040
- break;
7103
+ exp += xmlData[i];
7041
7104
  }
7042
- } else if (xmlData[i] === "[") {
7043
- hasBody = true;
7044
- } else {
7045
- exp += xmlData[i];
7046
7105
  }
7106
+ if (angleBracketsCount !== 0) {
7107
+ throw new Error(`Unclosed DOCTYPE`);
7108
+ }
7109
+ } else {
7110
+ throw new Error(`Invalid Tag instead of DOCTYPE`);
7047
7111
  }
7048
- if (angleBracketsCount !== 0) {
7049
- throw new Error(`Unclosed DOCTYPE`);
7050
- }
7051
- } else {
7052
- throw new Error(`Invalid Tag instead of DOCTYPE`);
7112
+ return { entities, i };
7053
7113
  }
7054
- return { entities, i };
7055
- }
7056
- var skipWhitespace = (data, index) => {
7057
- while (index < data.length && /\s/.test(data[index])) {
7058
- index++;
7059
- }
7060
- return index;
7061
- };
7062
- function readEntityExp(xmlData, i) {
7063
- i = skipWhitespace(xmlData, i);
7064
- let entityName = "";
7065
- while (i < xmlData.length && !/\s/.test(xmlData[i]) && xmlData[i] !== '"' && xmlData[i] !== "'") {
7066
- entityName += xmlData[i];
7067
- i++;
7068
- }
7069
- validateEntityName(entityName);
7070
- i = skipWhitespace(xmlData, i);
7071
- if (xmlData.substring(i, i + 6).toUpperCase() === "SYSTEM") {
7072
- throw new Error("External entities are not supported");
7073
- } else if (xmlData[i] === "%") {
7074
- throw new Error("Parameter entities are not supported");
7075
- }
7076
- let entityValue = "";
7077
- [i, entityValue] = readIdentifierVal(xmlData, i, "entity");
7078
- i--;
7079
- return [entityName, entityValue, i];
7080
- }
7081
- function readNotationExp(xmlData, i) {
7082
- i = skipWhitespace(xmlData, i);
7083
- let notationName = "";
7084
- while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7085
- notationName += xmlData[i];
7086
- i++;
7087
- }
7088
- validateEntityName(notationName);
7089
- i = skipWhitespace(xmlData, i);
7090
- const identifierType = xmlData.substring(i, i + 6).toUpperCase();
7091
- if (identifierType !== "SYSTEM" && identifierType !== "PUBLIC") {
7092
- throw new Error(`Expected SYSTEM or PUBLIC, found "${identifierType}"`);
7093
- }
7094
- i += identifierType.length;
7095
- i = skipWhitespace(xmlData, i);
7096
- let publicIdentifier = null;
7097
- let systemIdentifier = null;
7098
- if (identifierType === "PUBLIC") {
7099
- [i, publicIdentifier] = readIdentifierVal(xmlData, i, "publicIdentifier");
7114
+ readEntityExp(xmlData, i) {
7100
7115
  i = skipWhitespace(xmlData, i);
7101
- if (xmlData[i] === '"' || xmlData[i] === "'") {
7102
- [i, systemIdentifier] = readIdentifierVal(xmlData, i, "systemIdentifier");
7116
+ let entityName = "";
7117
+ while (i < xmlData.length && !/\s/.test(xmlData[i]) && xmlData[i] !== '"' && xmlData[i] !== "'") {
7118
+ entityName += xmlData[i];
7119
+ i++;
7103
7120
  }
7104
- } else if (identifierType === "SYSTEM") {
7105
- [i, systemIdentifier] = readIdentifierVal(xmlData, i, "systemIdentifier");
7106
- if (!systemIdentifier) {
7107
- throw new Error("Missing mandatory system identifier for SYSTEM notation");
7121
+ validateEntityName(entityName);
7122
+ i = skipWhitespace(xmlData, i);
7123
+ if (!this.suppressValidationErr) {
7124
+ if (xmlData.substring(i, i + 6).toUpperCase() === "SYSTEM") {
7125
+ throw new Error("External entities are not supported");
7126
+ } else if (xmlData[i] === "%") {
7127
+ throw new Error("Parameter entities are not supported");
7128
+ }
7129
+ }
7130
+ let entityValue = "";
7131
+ [i, entityValue] = this.readIdentifierVal(xmlData, i, "entity");
7132
+ if (this.options.enabled !== false && this.options.maxEntitySize && entityValue.length > this.options.maxEntitySize) {
7133
+ throw new Error(
7134
+ `Entity "${entityName}" size (${entityValue.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`
7135
+ );
7108
7136
  }
7137
+ i--;
7138
+ return [entityName, entityValue, i];
7109
7139
  }
7110
- return { notationName, publicIdentifier, systemIdentifier, index: --i };
7111
- }
7112
- function readIdentifierVal(xmlData, i, type) {
7113
- let identifierVal = "";
7114
- const startChar = xmlData[i];
7115
- if (startChar !== '"' && startChar !== "'") {
7116
- throw new Error(`Expected quoted string, found "${startChar}"`);
7140
+ readNotationExp(xmlData, i) {
7141
+ i = skipWhitespace(xmlData, i);
7142
+ let notationName = "";
7143
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7144
+ notationName += xmlData[i];
7145
+ i++;
7146
+ }
7147
+ !this.suppressValidationErr && validateEntityName(notationName);
7148
+ i = skipWhitespace(xmlData, i);
7149
+ const identifierType = xmlData.substring(i, i + 6).toUpperCase();
7150
+ if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") {
7151
+ throw new Error(`Expected SYSTEM or PUBLIC, found "${identifierType}"`);
7152
+ }
7153
+ i += identifierType.length;
7154
+ i = skipWhitespace(xmlData, i);
7155
+ let publicIdentifier = null;
7156
+ let systemIdentifier = null;
7157
+ if (identifierType === "PUBLIC") {
7158
+ [i, publicIdentifier] = this.readIdentifierVal(xmlData, i, "publicIdentifier");
7159
+ i = skipWhitespace(xmlData, i);
7160
+ if (xmlData[i] === '"' || xmlData[i] === "'") {
7161
+ [i, systemIdentifier] = this.readIdentifierVal(xmlData, i, "systemIdentifier");
7162
+ }
7163
+ } else if (identifierType === "SYSTEM") {
7164
+ [i, systemIdentifier] = this.readIdentifierVal(xmlData, i, "systemIdentifier");
7165
+ if (!this.suppressValidationErr && !systemIdentifier) {
7166
+ throw new Error("Missing mandatory system identifier for SYSTEM notation");
7167
+ }
7168
+ }
7169
+ return { notationName, publicIdentifier, systemIdentifier, index: --i };
7117
7170
  }
7118
- i++;
7119
- while (i < xmlData.length && xmlData[i] !== startChar) {
7120
- identifierVal += xmlData[i];
7171
+ readIdentifierVal(xmlData, i, type) {
7172
+ let identifierVal = "";
7173
+ const startChar = xmlData[i];
7174
+ if (startChar !== '"' && startChar !== "'") {
7175
+ throw new Error(`Expected quoted string, found "${startChar}"`);
7176
+ }
7121
7177
  i++;
7122
- }
7123
- if (xmlData[i] !== startChar) {
7124
- throw new Error(`Unterminated ${type} value`);
7125
- }
7126
- i++;
7127
- return [i, identifierVal];
7128
- }
7129
- function readElementExp(xmlData, i) {
7130
- i = skipWhitespace(xmlData, i);
7131
- let elementName = "";
7132
- while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7133
- elementName += xmlData[i];
7178
+ while (i < xmlData.length && xmlData[i] !== startChar) {
7179
+ identifierVal += xmlData[i];
7180
+ i++;
7181
+ }
7182
+ if (xmlData[i] !== startChar) {
7183
+ throw new Error(`Unterminated ${type} value`);
7184
+ }
7134
7185
  i++;
7186
+ return [i, identifierVal];
7135
7187
  }
7136
- if (!validateEntityName(elementName)) {
7137
- throw new Error(`Invalid element name: "${elementName}"`);
7188
+ readElementExp(xmlData, i) {
7189
+ i = skipWhitespace(xmlData, i);
7190
+ let elementName = "";
7191
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7192
+ elementName += xmlData[i];
7193
+ i++;
7194
+ }
7195
+ if (!this.suppressValidationErr && !isName(elementName)) {
7196
+ throw new Error(`Invalid element name: "${elementName}"`);
7197
+ }
7198
+ i = skipWhitespace(xmlData, i);
7199
+ let contentModel = "";
7200
+ if (xmlData[i] === "E" && hasSeq(xmlData, "MPTY", i)) i += 4;
7201
+ else if (xmlData[i] === "A" && hasSeq(xmlData, "NY", i)) i += 2;
7202
+ else if (xmlData[i] === "(") {
7203
+ i++;
7204
+ while (i < xmlData.length && xmlData[i] !== ")") {
7205
+ contentModel += xmlData[i];
7206
+ i++;
7207
+ }
7208
+ if (xmlData[i] !== ")") {
7209
+ throw new Error("Unterminated content model");
7210
+ }
7211
+ } else if (!this.suppressValidationErr) {
7212
+ throw new Error(`Invalid Element Expression, found "${xmlData[i]}"`);
7213
+ }
7214
+ return {
7215
+ elementName,
7216
+ contentModel: contentModel.trim(),
7217
+ index: i
7218
+ };
7138
7219
  }
7139
- i = skipWhitespace(xmlData, i);
7140
- let contentModel = "";
7141
- if (xmlData[i] === "E" && hasSeq(xmlData, "MPTY", i)) i += 4;
7142
- else if (xmlData[i] === "A" && hasSeq(xmlData, "NY", i)) i += 2;
7143
- else if (xmlData[i] === "(") {
7144
- i++;
7145
- while (i < xmlData.length && xmlData[i] !== ")") {
7146
- contentModel += xmlData[i];
7220
+ readAttlistExp(xmlData, i) {
7221
+ i = skipWhitespace(xmlData, i);
7222
+ let elementName = "";
7223
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7224
+ elementName += xmlData[i];
7225
+ i++;
7226
+ }
7227
+ validateEntityName(elementName);
7228
+ i = skipWhitespace(xmlData, i);
7229
+ let attributeName = "";
7230
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7231
+ attributeName += xmlData[i];
7147
7232
  i++;
7148
7233
  }
7149
- if (xmlData[i] !== ")") {
7150
- throw new Error("Unterminated content model");
7234
+ if (!validateEntityName(attributeName)) {
7235
+ throw new Error(`Invalid attribute name: "${attributeName}"`);
7151
7236
  }
7152
- } else {
7153
- throw new Error(`Invalid Element Expression, found "${xmlData[i]}"`);
7237
+ i = skipWhitespace(xmlData, i);
7238
+ let attributeType = "";
7239
+ if (xmlData.substring(i, i + 8).toUpperCase() === "NOTATION") {
7240
+ attributeType = "NOTATION";
7241
+ i += 8;
7242
+ i = skipWhitespace(xmlData, i);
7243
+ if (xmlData[i] !== "(") {
7244
+ throw new Error(`Expected '(', found "${xmlData[i]}"`);
7245
+ }
7246
+ i++;
7247
+ let allowedNotations = [];
7248
+ while (i < xmlData.length && xmlData[i] !== ")") {
7249
+ let notation = "";
7250
+ while (i < xmlData.length && xmlData[i] !== "|" && xmlData[i] !== ")") {
7251
+ notation += xmlData[i];
7252
+ i++;
7253
+ }
7254
+ notation = notation.trim();
7255
+ if (!validateEntityName(notation)) {
7256
+ throw new Error(`Invalid notation name: "${notation}"`);
7257
+ }
7258
+ allowedNotations.push(notation);
7259
+ if (xmlData[i] === "|") {
7260
+ i++;
7261
+ i = skipWhitespace(xmlData, i);
7262
+ }
7263
+ }
7264
+ if (xmlData[i] !== ")") {
7265
+ throw new Error("Unterminated list of notations");
7266
+ }
7267
+ i++;
7268
+ attributeType += " (" + allowedNotations.join("|") + ")";
7269
+ } else {
7270
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
7271
+ attributeType += xmlData[i];
7272
+ i++;
7273
+ }
7274
+ const validTypes = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
7275
+ if (!this.suppressValidationErr && !validTypes.includes(attributeType.toUpperCase())) {
7276
+ throw new Error(`Invalid attribute type: "${attributeType}"`);
7277
+ }
7278
+ }
7279
+ i = skipWhitespace(xmlData, i);
7280
+ let defaultValue = "";
7281
+ if (xmlData.substring(i, i + 8).toUpperCase() === "#REQUIRED") {
7282
+ defaultValue = "#REQUIRED";
7283
+ i += 8;
7284
+ } else if (xmlData.substring(i, i + 7).toUpperCase() === "#IMPLIED") {
7285
+ defaultValue = "#IMPLIED";
7286
+ i += 7;
7287
+ } else {
7288
+ [i, defaultValue] = this.readIdentifierVal(xmlData, i, "ATTLIST");
7289
+ }
7290
+ return {
7291
+ elementName,
7292
+ attributeName,
7293
+ attributeType,
7294
+ defaultValue,
7295
+ index: i
7296
+ };
7154
7297
  }
7155
- return {
7156
- elementName,
7157
- contentModel: contentModel.trim(),
7158
- index: i
7159
- };
7160
- }
7298
+ };
7299
+ var skipWhitespace = (data, index) => {
7300
+ while (index < data.length && /\s/.test(data[index])) {
7301
+ index++;
7302
+ }
7303
+ return index;
7304
+ };
7161
7305
  function hasSeq(data, seq, i) {
7162
7306
  for (let j = 0; j < seq.length; j++) {
7163
7307
  if (seq[j] !== data[i + j + 1]) return false;
@@ -7171,7 +7315,7 @@ function validateEntityName(name) {
7171
7315
  throw new Error(`Invalid entity name ${name}`);
7172
7316
  }
7173
7317
 
7174
- // ../../.yarn/cache/strnum-npm-2.1.1-2f45f2aae3-d5fe6e4333.zip/node_modules/strnum/strnum.js
7318
+ // ../../.yarn/cache/strnum-npm-2.2.0-671febd32d-2969dbc844.zip/node_modules/strnum/strnum.js
7175
7319
  var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
7176
7320
  var numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
7177
7321
  var consider = {
@@ -7179,8 +7323,10 @@ var consider = {
7179
7323
  // oct: false,
7180
7324
  leadingZeros: true,
7181
7325
  decimalPoint: ".",
7182
- eNotation: true
7183
- //skipLike: /regex/
7326
+ eNotation: true,
7327
+ //skipLike: /regex/,
7328
+ infinity: "original"
7329
+ // "null", "infinity" (Infinity type), "string" ("Infinity" (the string literal))
7184
7330
  };
7185
7331
  function toNumber(str, options2 = {}) {
7186
7332
  options2 = Object.assign({}, consider, options2);
@@ -7190,7 +7336,9 @@ function toNumber(str, options2 = {}) {
7190
7336
  else if (str === "0") return 0;
7191
7337
  else if (options2.hex && hexRegex.test(trimmedStr)) {
7192
7338
  return parse_int(trimmedStr, 16);
7193
- } else if (trimmedStr.search(/.+[eE].+/) !== -1) {
7339
+ } else if (!isFinite(trimmedStr)) {
7340
+ return handleInfinity(str, Number(trimmedStr), options2);
7341
+ } else if (trimmedStr.includes("e") || trimmedStr.includes("E")) {
7194
7342
  return resolveEnotation(str, trimmedStr, options2);
7195
7343
  } else {
7196
7344
  const match = numRegex.exec(trimmedStr);
@@ -7268,8 +7416,23 @@ function parse_int(numStr, base) {
7268
7416
  else if (window && window.parseInt) return window.parseInt(numStr, base);
7269
7417
  else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
7270
7418
  }
7419
+ function handleInfinity(str, num, options2) {
7420
+ const isPositive = num === Infinity;
7421
+ switch (options2.infinity.toLowerCase()) {
7422
+ case "null":
7423
+ return null;
7424
+ case "infinity":
7425
+ return num;
7426
+ // Return Infinity or -Infinity
7427
+ case "string":
7428
+ return isPositive ? "Infinity" : "-Infinity";
7429
+ case "original":
7430
+ default:
7431
+ return str;
7432
+ }
7433
+ }
7271
7434
 
7272
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/ignoreAttributes.js
7435
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/ignoreAttributes.js
7273
7436
  function getIgnoreAttributesFn(ignoreAttributes) {
7274
7437
  if (typeof ignoreAttributes === "function") {
7275
7438
  return ignoreAttributes;
@@ -7289,7 +7452,7 @@ function getIgnoreAttributesFn(ignoreAttributes) {
7289
7452
  return () => false;
7290
7453
  }
7291
7454
 
7292
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
7455
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
7293
7456
  var OrderedObjParser = class {
7294
7457
  constructor(options2) {
7295
7458
  this.options = options2;
@@ -7317,8 +7480,8 @@ var OrderedObjParser = class {
7317
7480
  "copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
7318
7481
  "reg": { regex: /&(reg|#174);/g, val: "\xAE" },
7319
7482
  "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" },
7320
- "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCodePoint(Number.parseInt(str, 10)) },
7321
- "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCodePoint(Number.parseInt(str, 16)) }
7483
+ "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => fromCodePoint(str, 10, "&#") },
7484
+ "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => fromCodePoint(str, 16, "&#x") }
7322
7485
  };
7323
7486
  this.addExternalEntities = addExternalEntities;
7324
7487
  this.parseXml = parseXml;
@@ -7331,14 +7494,30 @@ var OrderedObjParser = class {
7331
7494
  this.saveTextToParentTag = saveTextToParentTag;
7332
7495
  this.addChild = addChild;
7333
7496
  this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes);
7497
+ this.entityExpansionCount = 0;
7498
+ this.currentExpandedLength = 0;
7499
+ if (this.options.stopNodes && this.options.stopNodes.length > 0) {
7500
+ this.stopNodesExact = /* @__PURE__ */ new Set();
7501
+ this.stopNodesWildcard = /* @__PURE__ */ new Set();
7502
+ for (let i = 0; i < this.options.stopNodes.length; i++) {
7503
+ const stopNodeExp = this.options.stopNodes[i];
7504
+ if (typeof stopNodeExp !== "string") continue;
7505
+ if (stopNodeExp.startsWith("*.")) {
7506
+ this.stopNodesWildcard.add(stopNodeExp.substring(2));
7507
+ } else {
7508
+ this.stopNodesExact.add(stopNodeExp);
7509
+ }
7510
+ }
7511
+ }
7334
7512
  }
7335
7513
  };
7336
7514
  function addExternalEntities(externalEntities) {
7337
7515
  const entKeys = Object.keys(externalEntities);
7338
7516
  for (let i = 0; i < entKeys.length; i++) {
7339
7517
  const ent = entKeys[i];
7518
+ const escaped = ent.replace(/[.\-+*:]/g, "\\.");
7340
7519
  this.lastEntities[ent] = {
7341
- regex: new RegExp("&" + ent + ";", "g"),
7520
+ regex: new RegExp("&" + escaped + ";", "g"),
7342
7521
  val: externalEntities[ent]
7343
7522
  };
7344
7523
  }
@@ -7349,7 +7528,7 @@ function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode,
7349
7528
  val = val.trim();
7350
7529
  }
7351
7530
  if (val.length > 0) {
7352
- if (!escapeEntities) val = this.replaceEntitiesValue(val);
7531
+ if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);
7353
7532
  const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);
7354
7533
  if (newval === null || newval === void 0) {
7355
7534
  return val;
@@ -7403,7 +7582,7 @@ function buildAttributesMap(attrStr, jPath, tagName) {
7403
7582
  if (this.options.trimValues) {
7404
7583
  oldVal = oldVal.trim();
7405
7584
  }
7406
- oldVal = this.replaceEntitiesValue(oldVal);
7585
+ oldVal = this.replaceEntitiesValue(oldVal, tagName, jPath);
7407
7586
  const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
7408
7587
  if (newVal === null || newVal === void 0) {
7409
7588
  attrs[aName] = oldVal;
@@ -7438,6 +7617,9 @@ var parseXml = function(xmlData) {
7438
7617
  let currentNode = xmlObj;
7439
7618
  let textData = "";
7440
7619
  let jPath = "";
7620
+ this.entityExpansionCount = 0;
7621
+ this.currentExpandedLength = 0;
7622
+ const docTypeReader = new DocTypeReader(this.options.processEntities);
7441
7623
  for (let i = 0; i < xmlData.length; i++) {
7442
7624
  const ch = xmlData[i];
7443
7625
  if (ch === "<") {
@@ -7494,7 +7676,7 @@ var parseXml = function(xmlData) {
7494
7676
  }
7495
7677
  i = endIndex;
7496
7678
  } else if (xmlData.substr(i + 1, 2) === "!D") {
7497
- const result = readDocType(xmlData, i);
7679
+ const result = docTypeReader.readDocType(xmlData, i);
7498
7680
  this.docTypeEntities = result.entities;
7499
7681
  i = result.i;
7500
7682
  } else if (xmlData.substr(i + 1, 2) === "![") {
@@ -7517,7 +7699,14 @@ var parseXml = function(xmlData) {
7517
7699
  let attrExpPresent = result.attrExpPresent;
7518
7700
  let closeIndex = result.closeIndex;
7519
7701
  if (this.options.transformTagName) {
7520
- tagName = this.options.transformTagName(tagName);
7702
+ const newTagName = this.options.transformTagName(tagName);
7703
+ if (tagExp === tagName) {
7704
+ tagExp = newTagName;
7705
+ }
7706
+ tagName = newTagName;
7707
+ }
7708
+ if (this.options.strictReservedNames && (tagName === this.options.commentPropName || tagName === this.options.cdataPropName)) {
7709
+ throw new Error(`Invalid tag name: ${tagName}`);
7521
7710
  }
7522
7711
  if (currentNode && textData) {
7523
7712
  if (currentNode.tagname !== "!xml") {
@@ -7533,7 +7722,7 @@ var parseXml = function(xmlData) {
7533
7722
  jPath += jPath ? "." + tagName : tagName;
7534
7723
  }
7535
7724
  const startIndex = i;
7536
- if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
7725
+ if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, jPath, tagName)) {
7537
7726
  let tagContent = "";
7538
7727
  if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
7539
7728
  if (tagName[tagName.length - 1] === "/") {
@@ -7572,7 +7761,11 @@ var parseXml = function(xmlData) {
7572
7761
  tagExp = tagExp.substr(0, tagExp.length - 1);
7573
7762
  }
7574
7763
  if (this.options.transformTagName) {
7575
- tagName = this.options.transformTagName(tagName);
7764
+ const newTagName = this.options.transformTagName(tagName);
7765
+ if (tagExp === tagName) {
7766
+ tagExp = newTagName;
7767
+ }
7768
+ tagName = newTagName;
7576
7769
  }
7577
7770
  const childNode = new XmlNode(tagName);
7578
7771
  if (tagName !== tagExp && attrExpPresent) {
@@ -7580,8 +7773,20 @@ var parseXml = function(xmlData) {
7580
7773
  }
7581
7774
  this.addChild(currentNode, childNode, jPath, startIndex);
7582
7775
  jPath = jPath.substr(0, jPath.lastIndexOf("."));
7776
+ } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
7777
+ const childNode = new XmlNode(tagName);
7778
+ if (tagName !== tagExp && attrExpPresent) {
7779
+ childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
7780
+ }
7781
+ this.addChild(currentNode, childNode, jPath, startIndex);
7782
+ jPath = jPath.substr(0, jPath.lastIndexOf("."));
7783
+ i = result.closeIndex;
7784
+ continue;
7583
7785
  } else {
7584
7786
  const childNode = new XmlNode(tagName);
7787
+ if (this.tagsNodeStack.length > this.options.maxNestedTags) {
7788
+ throw new Error("Maximum nested tags exceeded");
7789
+ }
7585
7790
  this.tagsNodeStack.push(currentNode);
7586
7791
  if (tagName !== tagExp && attrExpPresent) {
7587
7792
  childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
@@ -7610,49 +7815,81 @@ function addChild(currentNode, childNode, jPath, startIndex) {
7610
7815
  currentNode.addChild(childNode, startIndex);
7611
7816
  }
7612
7817
  }
7613
- var replaceEntitiesValue = function(val) {
7614
- if (this.options.processEntities) {
7615
- for (let entityName in this.docTypeEntities) {
7616
- const entity = this.docTypeEntities[entityName];
7617
- val = val.replace(entity.regx, entity.val);
7818
+ var replaceEntitiesValue = function(val, tagName, jPath) {
7819
+ if (val.indexOf("&") === -1) {
7820
+ return val;
7821
+ }
7822
+ const entityConfig = this.options.processEntities;
7823
+ if (!entityConfig.enabled) {
7824
+ return val;
7825
+ }
7826
+ if (entityConfig.allowedTags) {
7827
+ if (!entityConfig.allowedTags.includes(tagName)) {
7828
+ return val;
7618
7829
  }
7619
- for (let entityName in this.lastEntities) {
7620
- const entity = this.lastEntities[entityName];
7621
- val = val.replace(entity.regex, entity.val);
7830
+ }
7831
+ if (entityConfig.tagFilter) {
7832
+ if (!entityConfig.tagFilter(tagName, jPath)) {
7833
+ return val;
7622
7834
  }
7623
- if (this.options.htmlEntities) {
7624
- for (let entityName in this.htmlEntities) {
7625
- const entity = this.htmlEntities[entityName];
7626
- val = val.replace(entity.regex, entity.val);
7835
+ }
7836
+ for (let entityName in this.docTypeEntities) {
7837
+ const entity = this.docTypeEntities[entityName];
7838
+ const matches = val.match(entity.regx);
7839
+ if (matches) {
7840
+ this.entityExpansionCount += matches.length;
7841
+ if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
7842
+ throw new Error(
7843
+ `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
7844
+ );
7627
7845
  }
7846
+ const lengthBefore = val.length;
7847
+ val = val.replace(entity.regx, entity.val);
7848
+ if (entityConfig.maxExpandedLength) {
7849
+ this.currentExpandedLength += val.length - lengthBefore;
7850
+ if (this.currentExpandedLength > entityConfig.maxExpandedLength) {
7851
+ throw new Error(
7852
+ `Total expanded content size exceeded: ${this.currentExpandedLength} > ${entityConfig.maxExpandedLength}`
7853
+ );
7854
+ }
7855
+ }
7856
+ }
7857
+ }
7858
+ if (val.indexOf("&") === -1) return val;
7859
+ for (let entityName in this.lastEntities) {
7860
+ const entity = this.lastEntities[entityName];
7861
+ val = val.replace(entity.regex, entity.val);
7862
+ }
7863
+ if (val.indexOf("&") === -1) return val;
7864
+ if (this.options.htmlEntities) {
7865
+ for (let entityName in this.htmlEntities) {
7866
+ const entity = this.htmlEntities[entityName];
7867
+ val = val.replace(entity.regex, entity.val);
7628
7868
  }
7629
- val = val.replace(this.ampEntity.regex, this.ampEntity.val);
7630
7869
  }
7870
+ val = val.replace(this.ampEntity.regex, this.ampEntity.val);
7631
7871
  return val;
7632
7872
  };
7633
- function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
7873
+ function saveTextToParentTag(textData, parentNode, jPath, isLeafNode) {
7634
7874
  if (textData) {
7635
- if (isLeafNode === void 0) isLeafNode = currentNode.child.length === 0;
7875
+ if (isLeafNode === void 0) isLeafNode = parentNode.child.length === 0;
7636
7876
  textData = this.parseTextData(
7637
7877
  textData,
7638
- currentNode.tagname,
7878
+ parentNode.tagname,
7639
7879
  jPath,
7640
7880
  false,
7641
- currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
7881
+ parentNode[":@"] ? Object.keys(parentNode[":@"]).length !== 0 : false,
7642
7882
  isLeafNode
7643
7883
  );
7644
7884
  if (textData !== void 0 && textData !== "")
7645
- currentNode.add(this.options.textNodeName, textData);
7885
+ parentNode.add(this.options.textNodeName, textData);
7646
7886
  textData = "";
7647
7887
  }
7648
7888
  return textData;
7649
7889
  }
7650
- function isItStopNode(stopNodes, jPath, currentTagName) {
7651
- const allNodesExp = "*." + currentTagName;
7652
- for (const stopNodePath in stopNodes) {
7653
- const stopNodeExp = stopNodes[stopNodePath];
7654
- if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true;
7655
- }
7890
+ function isItStopNode(stopNodesExact, stopNodesWildcard, jPath, currentTagName) {
7891
+ if (stopNodesWildcard && stopNodesWildcard.has(currentTagName)) return true;
7892
+ if (stopNodesExact && stopNodesExact.has(jPath)) return true;
7656
7893
  return false;
7657
7894
  }
7658
7895
  function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
@@ -7774,8 +8011,16 @@ function parseValue(val, shouldParse, options2) {
7774
8011
  }
7775
8012
  }
7776
8013
  }
8014
+ function fromCodePoint(str, base, prefix) {
8015
+ const codePoint = Number.parseInt(str, base);
8016
+ if (codePoint >= 0 && codePoint <= 1114111) {
8017
+ return String.fromCodePoint(codePoint);
8018
+ } else {
8019
+ return prefix + str + ";";
8020
+ }
8021
+ }
7777
8022
 
7778
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/node2json.js
8023
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/node2json.js
7779
8024
  var METADATA_SYMBOL2 = XmlNode.getMetaDataSymbol();
7780
8025
  function prettify(node, options2) {
7781
8026
  return compress(node, options2);
@@ -7797,9 +8042,6 @@ function compress(arr, options2, jPath) {
7797
8042
  } else if (tagObj[property]) {
7798
8043
  let val = compress(tagObj[property], options2, newJpath);
7799
8044
  const isLeaf = isLeafTag(val, options2);
7800
- if (tagObj[METADATA_SYMBOL2] !== void 0) {
7801
- val[METADATA_SYMBOL2] = tagObj[METADATA_SYMBOL2];
7802
- }
7803
8045
  if (tagObj[":@"]) {
7804
8046
  assignAttributes(val, tagObj[":@"], newJpath, options2);
7805
8047
  } else if (Object.keys(val).length === 1 && val[options2.textNodeName] !== void 0 && !options2.alwaysCreateTextNode) {
@@ -7808,7 +8050,10 @@ function compress(arr, options2, jPath) {
7808
8050
  if (options2.alwaysCreateTextNode) val[options2.textNodeName] = "";
7809
8051
  else val = "";
7810
8052
  }
7811
- if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {
8053
+ if (tagObj[METADATA_SYMBOL2] !== void 0 && typeof val === "object" && val !== null) {
8054
+ val[METADATA_SYMBOL2] = tagObj[METADATA_SYMBOL2];
8055
+ }
8056
+ if (compressedObj[property] !== void 0 && Object.prototype.hasOwnProperty.call(compressedObj, property)) {
7812
8057
  if (!Array.isArray(compressedObj[property])) {
7813
8058
  compressedObj[property] = [compressedObj[property]];
7814
8059
  }
@@ -7860,7 +8105,7 @@ function isLeafTag(obj, options2) {
7860
8105
  return false;
7861
8106
  }
7862
8107
 
7863
- // ../../.yarn/cache/fast-xml-parser-npm-5.2.5-4fd49da1b5-305017cff6.zip/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
8108
+ // ../../.yarn/cache/fast-xml-parser-npm-5.4.1-48bbd2c631-2b40067c3a.zip/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
7864
8109
  var XMLParser = class {
7865
8110
  constructor(options2) {
7866
8111
  this.externalEntities = {};
@@ -7868,14 +8113,13 @@ var XMLParser = class {
7868
8113
  }
7869
8114
  /**
7870
8115
  * Parse XML dats to JS object
7871
- * @param {string|Buffer} xmlData
8116
+ * @param {string|Uint8Array} xmlData
7872
8117
  * @param {boolean|Object} validationOption
7873
8118
  */
7874
8119
  parse(xmlData, validationOption) {
7875
- if (typeof xmlData === "string") {
7876
- } else if (xmlData.toString) {
8120
+ if (typeof xmlData !== "string" && xmlData.toString) {
7877
8121
  xmlData = xmlData.toString();
7878
- } else {
8122
+ } else if (typeof xmlData !== "string") {
7879
8123
  throw new Error("XML data is accepted in String or Bytes[] form.");
7880
8124
  }
7881
8125
  if (validationOption) {
@@ -19112,7 +19356,7 @@ export const ${node.name}: ${node.name}Namespace & {
19112
19356
  def.push(`
19113
19357
  constructor(properties?: Partial<${girClass.name}.ConstructorProps>, ...args: any[]);
19114
19358
  `);
19115
- if (!girClass.__ts__indexSignature || girClass.__ts__indexSignature.includes("[key: string]: any")) {
19359
+ if (girClass instanceof IntrospectedClass && (!girClass.__ts__indexSignature || girClass.__ts__indexSignature.includes("[key: string]: any"))) {
19116
19360
  def.push("_init(...args: any[]): void;\n");
19117
19361
  }
19118
19362
  def.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-for-gir/cli",
3
- "version": "4.0.0-beta.37",
3
+ "version": "4.0.0-beta.39",
4
4
  "description": "TypeScript type definition generator for GObject introspection GIR files",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -18,8 +18,7 @@
18
18
  "start:prod": "node bin/ts-for-gir",
19
19
  "build": "node --experimental-specifier-resolution=node --experimental-strip-types --experimental-transform-types --no-warnings esbuild.ts && chmod +x bin/ts-for-gir-dev && chmod +x bin/ts-for-gir",
20
20
  "check:types": "tsc --noEmit",
21
- "check:deps": "dpdm -T src/index.ts",
22
- "check": "yarn check:types && yarn check:deps"
21
+ "check": "yarn check:types"
23
22
  },
24
23
  "repository": {
25
24
  "type": "git",
@@ -53,30 +52,29 @@
53
52
  ".": "./src/index.ts"
54
53
  },
55
54
  "devDependencies": {
56
- "@gi.ts/parser": "^4.0.0-beta.37",
57
- "@ts-for-gir/generator-base": "^4.0.0-beta.37",
58
- "@ts-for-gir/generator-html-doc": "^4.0.0-beta.37",
59
- "@ts-for-gir/generator-json": "^4.0.0-beta.37",
60
- "@ts-for-gir/generator-typescript": "^4.0.0-beta.37",
61
- "@ts-for-gir/lib": "^4.0.0-beta.37",
62
- "@ts-for-gir/reporter": "^4.0.0-beta.37",
55
+ "@gi.ts/parser": "^4.0.0-beta.39",
56
+ "@ts-for-gir/generator-base": "^4.0.0-beta.39",
57
+ "@ts-for-gir/generator-html-doc": "^4.0.0-beta.39",
58
+ "@ts-for-gir/generator-json": "^4.0.0-beta.39",
59
+ "@ts-for-gir/generator-typescript": "^4.0.0-beta.39",
60
+ "@ts-for-gir/lib": "^4.0.0-beta.39",
61
+ "@ts-for-gir/reporter": "^4.0.0-beta.39",
63
62
  "@types/ejs": "^3.1.5",
64
63
  "@types/inquirer": "^9.0.9",
65
- "@types/node": "^24.5.2",
66
- "@types/yargs": "^17.0.33",
67
- "dpdm": "^3.14.0",
68
- "esbuild": "^0.25.10",
69
- "typescript": "^5.9.2"
64
+ "@types/node": "^24.11.0",
65
+ "@types/yargs": "^17.0.35",
66
+ "esbuild": "^0.27.3",
67
+ "typescript": "^5.9.3"
70
68
  },
71
69
  "dependencies": {
72
- "@inquirer/prompts": "^7.8.6",
73
- "@ts-for-gir/templates": "^4.0.0-beta.37",
70
+ "@inquirer/prompts": "^8.3.0",
71
+ "@ts-for-gir/templates": "^4.0.0-beta.39",
74
72
  "colorette": "^2.0.20",
75
73
  "cosmiconfig": "^9.0.0",
76
- "ejs": "^3.1.10",
77
- "glob": "^11.0.3",
78
- "inquirer": "^12.9.6",
79
- "prettier": "^3.6.2",
74
+ "ejs": "^4.0.1",
75
+ "glob": "^13.0.6",
76
+ "inquirer": "^13.3.0",
77
+ "prettier": "^3.8.1",
80
78
  "yargs": "^18.0.0"
81
79
  }
82
80
  }
@@ -2,109 +2,109 @@
2
2
  * Base interface for all command arguments extending ConfigFlags
3
3
  */
4
4
  export interface BaseCommandArgs {
5
- /** GIR modules to load, e.g. 'Gio-2.0'. Accepts multiple modules */
6
- modules: string[]
7
- /** GIR directories */
8
- girDirectories: string[]
9
- /** Root directory of your project */
10
- root: string
11
- /** Modules that should be ignored */
12
- ignore: string[]
13
- /** Specify a custom name for the configuration file */
14
- configName: string
15
- /** Switch on/off the verbose mode */
16
- verbose: boolean
5
+ /** GIR modules to load, e.g. 'Gio-2.0'. Accepts multiple modules */
6
+ modules: string[];
7
+ /** GIR directories */
8
+ girDirectories: string[];
9
+ /** Root directory of your project */
10
+ root: string;
11
+ /** Modules that should be ignored */
12
+ ignore: string[];
13
+ /** Specify a custom name for the configuration file */
14
+ configName: string;
15
+ /** Switch on/off the verbose mode */
16
+ verbose: boolean;
17
17
  }
18
18
 
19
19
  /**
20
20
  * Arguments for the generate command
21
21
  */
22
22
  export interface GenerateCommandArgs extends BaseCommandArgs {
23
- /** Directory to output to */
24
- outdir: string | null
25
- /** Skip prompts for library version selection when multiple versions are detected */
26
- ignoreVersionConflicts: boolean
27
- /** Print the output to console and create no files */
28
- print: boolean
29
- /** Do not export all symbols for each module as a namespace */
30
- noNamespace: boolean
31
- /** Do not generate documentation comments */
32
- noComments: boolean
33
- /** Generate promisified functions for async/finish calls */
34
- promisify: boolean
35
- /** Scope of the generated NPM packages */
36
- npmScope: string
37
- /** Uses the workspace protocol for the generated packages which can be used with package managers like Yarn and PNPM */
38
- workspace: boolean
39
- /** Only use the version prefix for the ambient module exports */
40
- onlyVersionPrefix: boolean
41
- /** Do not prettify the generated types */
42
- noPrettyPrint: boolean
43
- /** Disable GLib.Variant class with string parsing */
44
- noAdvancedVariants: boolean
45
- /** Generate the typescript types with package.json support */
46
- package: boolean
47
- /** Enable generation problem reporter and create a detailed report file */
48
- reporter: boolean
49
- /** Output file path for the reporter */
50
- reporterOutput: string
23
+ /** Directory to output to */
24
+ outdir: string | null;
25
+ /** Skip prompts for library version selection when multiple versions are detected */
26
+ ignoreVersionConflicts: boolean;
27
+ /** Print the output to console and create no files */
28
+ print: boolean;
29
+ /** Do not export all symbols for each module as a namespace */
30
+ noNamespace: boolean;
31
+ /** Do not generate documentation comments */
32
+ noComments: boolean;
33
+ /** Generate promisified functions for async/finish calls */
34
+ promisify: boolean;
35
+ /** Scope of the generated NPM packages */
36
+ npmScope: string;
37
+ /** Uses the workspace protocol for the generated packages which can be used with package managers like Yarn and PNPM */
38
+ workspace: boolean;
39
+ /** Only use the version prefix for the ambient module exports */
40
+ onlyVersionPrefix: boolean;
41
+ /** Do not prettify the generated types */
42
+ noPrettyPrint: boolean;
43
+ /** Disable GLib.Variant class with string parsing */
44
+ noAdvancedVariants: boolean;
45
+ /** Generate the typescript types with package.json support */
46
+ package: boolean;
47
+ /** Enable generation problem reporter and create a detailed report file */
48
+ reporter: boolean;
49
+ /** Output file path for the reporter */
50
+ reporterOutput: string;
51
51
  }
52
52
 
53
53
  /**
54
54
  * Arguments for the list command
55
55
  */
56
56
  export interface ListCommandArgs extends BaseCommandArgs {
57
- // List command only uses base arguments
57
+ // List command only uses base arguments
58
58
  }
59
59
 
60
60
  /**
61
61
  * Arguments for the copy command
62
62
  */
63
63
  export interface CopyCommandArgs extends BaseCommandArgs {
64
- /** Directory to output to */
65
- outdir: string | null
64
+ /** Directory to output to */
65
+ outdir: string | null;
66
66
  }
67
67
 
68
68
  /**
69
69
  * Arguments for the doc command
70
70
  */
71
71
  export interface DocCommandArgs extends BaseCommandArgs {
72
- /** Directory to output to */
73
- outdir: string | null
74
- /** Skip prompts for library version selection when multiple versions are detected */
75
- ignoreVersionConflicts: boolean
72
+ /** Directory to output to */
73
+ outdir: string | null;
74
+ /** Skip prompts for library version selection when multiple versions are detected */
75
+ ignoreVersionConflicts: boolean;
76
76
  }
77
77
 
78
78
  /**
79
79
  * Arguments for the analyze command
80
80
  */
81
81
  export interface AnalyzeCommandArgs {
82
- /** Path to the report file to analyze */
83
- reportFile: string
84
- /** Filter by problem severity (debug, info, warning, error, critical) */
85
- severity?: string[]
86
- /** Filter by problem category */
87
- category?: string[]
88
- /** Filter by namespace/module */
89
- namespace?: string[]
90
- /** Filter by specific type name */
91
- type?: string[]
92
- /** Show top N most problematic items */
93
- top?: number
94
- /** Export filtered results to file */
95
- export?: string
96
- /** Output format (json, csv, table) */
97
- format?: string
98
- /** Show detailed problem information */
99
- detailed?: boolean
100
- /** Show summary statistics only */
101
- summary?: boolean
102
- /** Search for problems containing specific text */
103
- search?: string
104
- /** Show problems from a specific time range (ISO date) */
105
- since?: string
106
- /** Show problems until a specific time (ISO date) */
107
- until?: string
108
- /** Switch on/off the verbose mode */
109
- verbose?: boolean
110
- }
82
+ /** Path to the report file to analyze */
83
+ reportFile: string;
84
+ /** Filter by problem severity (debug, info, warning, error, critical) */
85
+ severity?: string[];
86
+ /** Filter by problem category */
87
+ category?: string[];
88
+ /** Filter by namespace/module */
89
+ namespace?: string[];
90
+ /** Filter by specific type name */
91
+ type?: string[];
92
+ /** Show top N most problematic items */
93
+ top?: number;
94
+ /** Export filtered results to file */
95
+ export?: string;
96
+ /** Output format (json, csv, table) */
97
+ format?: string;
98
+ /** Show detailed problem information */
99
+ detailed?: boolean;
100
+ /** Show summary statistics only */
101
+ summary?: boolean;
102
+ /** Search for problems containing specific text */
103
+ search?: string;
104
+ /** Show problems from a specific time range (ISO date) */
105
+ since?: string;
106
+ /** Show problems until a specific time (ISO date) */
107
+ until?: string;
108
+ /** Switch on/off the verbose mode */
109
+ verbose?: boolean;
110
+ }
@@ -1,15 +1,17 @@
1
+ import type { ConfigFlags } from "@ts-for-gir/lib";
2
+ import type { BuilderCallback } from "yargs";
1
3
  /**
2
4
  * Base interface for command definition structure
3
5
  */
4
6
  export interface CommandDefinition<TArgs> {
5
- /** Command name and parameters */
6
- command: string
7
- /** Command description */
8
- description: string
9
- /** Builder function for yargs configuration */
10
- builder: (yargs: any) => any
11
- /** Handler function for command execution */
12
- handler: (args: TArgs) => Promise<void>
13
- /** Example usage array */
14
- examples: ReadonlyArray<[string, string?]>
15
- }
7
+ /** Command name and parameters */
8
+ command: string;
9
+ /** Command description */
10
+ description: string;
11
+ /** Builder function for yargs configuration */
12
+ builder: BuilderCallback<TArgs, ConfigFlags>;
13
+ /** Handler function for command execution */
14
+ handler: (args: ConfigFlags) => Promise<void>;
15
+ /** Example usage array */
16
+ examples: ReadonlyArray<[string, string?]>;
17
+ }
@@ -1,35 +1,30 @@
1
1
  /**
2
2
  * Type definitions for command structure and exports
3
3
  */
4
- import type {
5
- GenerateCommandArgs,
6
- ListCommandArgs,
7
- CopyCommandArgs,
8
- DocCommandArgs
9
- } from './command-args.ts'
10
- import type { CommandDefinition } from './command-definition.ts'
4
+ import type { CopyCommandArgs, DocCommandArgs, GenerateCommandArgs, ListCommandArgs } from "./command-args.ts";
5
+ import type { CommandDefinition } from "./command-definition.ts";
11
6
 
12
7
  /**
13
8
  * Generate command definition type
14
9
  */
15
- export type GenerateCommand = CommandDefinition<GenerateCommandArgs>
10
+ export type GenerateCommand = CommandDefinition<GenerateCommandArgs>;
16
11
 
17
12
  /**
18
13
  * List command definition type
19
14
  */
20
- export type ListCommand = CommandDefinition<ListCommandArgs>
15
+ export type ListCommand = CommandDefinition<ListCommandArgs>;
21
16
 
22
17
  /**
23
18
  * Copy command definition type
24
19
  */
25
- export type CopyCommand = CommandDefinition<CopyCommandArgs>
20
+ export type CopyCommand = CommandDefinition<CopyCommandArgs>;
26
21
 
27
22
  /**
28
23
  * Doc command definition type
29
24
  */
30
- export type DocCommand = CommandDefinition<DocCommandArgs>
25
+ export type DocCommand = CommandDefinition<DocCommandArgs>;
31
26
 
32
27
  /**
33
28
  * Union type for all command types
34
29
  */
35
- export type AnyCommand = GenerateCommand | ListCommand | CopyCommand | DocCommand
30
+ export type AnyCommand = GenerateCommand | ListCommand | CopyCommand | DocCommand;
@@ -3,13 +3,13 @@
3
3
  */
4
4
 
5
5
  // Command argument interfaces
6
- export * from './command-args.ts'
6
+ export * from "./command-args.ts";
7
7
 
8
8
  // Command definition interfaces
9
- export * from './command-definition.ts'
9
+ export * from "./command-definition.ts";
10
10
 
11
11
  // Command type definitions
12
- export * from './commands.ts'
12
+ export * from "./commands.ts";
13
13
 
14
14
  // Report analysis types
15
- export * from './report-types.ts'
15
+ export * from "./report-types.ts";
@@ -31,4 +31,4 @@ export interface ReportData {
31
31
  metadata: ReportMetadata;
32
32
  statistics: ReportStatistics;
33
33
  problems: ProblemEntry[];
34
- }
34
+ }