@magic-xpa/utils 4.1201.0-dev4121.306 → 4.1201.0-dev4121.308
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/README.md +6 -6
- package/fesm2022/magic-xpa-utils.mjs +23 -2
- package/fesm2022/magic-xpa-utils.mjs.map +1 -1
- package/package.json +6 -6
- package/types/magic-xpa-utils.d.ts +2847 -0
- package/index.d.ts +0 -29
- package/src/Base64.d.ts +0 -17
- package/src/ChoiceUtils.d.ts +0 -5
- package/src/Constants.d.ts +0 -71
- package/src/DateTimeUtils.d.ts +0 -5
- package/src/DateUtil.d.ts +0 -6
- package/src/InternalInterface.d.ts +0 -337
- package/src/JSON_Utils.d.ts +0 -3
- package/src/Logger.d.ts +0 -49
- package/src/MagicConstants.d.ts +0 -9
- package/src/Misc.d.ts +0 -13
- package/src/MsgInterface.d.ts +0 -180
- package/src/PICInterface.d.ts +0 -50
- package/src/PlatformUtils.d.ts +0 -5
- package/src/Queue.d.ts +0 -9
- package/src/Randomizer.d.ts +0 -14
- package/src/RequestInfo.d.ts +0 -15
- package/src/Rtf.d.ts +0 -152
- package/src/StorageAttribute.d.ts +0 -14
- package/src/StrUtil.d.ts +0 -46
- package/src/SyncExecutionHelper.d.ts +0 -7
- package/src/UtilDateJpn.d.ts +0 -19
- package/src/UtilImeJpn.d.ts +0 -9
- package/src/UtilStrByteMode.d.ts +0 -27
- package/src/XMLConstants.d.ts +0 -170
- package/src/Xml/XmlParser.d.ts +0 -34
- package/src/enums.d.ts +0 -1564
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Magic-xpa/utils
|
|
2
|
-
|
|
3
|
-
This package is part of Magic xpa Web Application Framework.
|
|
4
|
-
It is used to easily create modern business apps powered by Angular to provide a rich user experience and meet the increasingly complex enterprise business expectations for digital transformation.
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# Magic-xpa/utils
|
|
2
|
+
|
|
3
|
+
This package is part of Magic xpa Web Application Framework.
|
|
4
|
+
It is used to easily create modern business apps powered by Angular to provide a rich user experience and meet the increasingly complex enterprise business expectations for digital transformation.
|
|
5
|
+
|
|
6
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Encoding, StringBuilder, Hashtable, Stack, NChar, NNumber, NString, RefParam, isNullOrUndefined, DateTime, ISO_8859_1_Encoding, ApplicationException, Int32, Exception, List, Thread, Debug } from '@magic-xpa/mscorelib';
|
|
2
|
-
import {
|
|
2
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
3
3
|
|
|
4
4
|
/// <summary>JPN: DBCS support
|
|
5
5
|
/// Utility Class for String
|
|
@@ -5020,9 +5020,30 @@ class InternalInterface {
|
|
|
5020
5020
|
}
|
|
5021
5021
|
}
|
|
5022
5022
|
|
|
5023
|
+
const parser = new XMLParser({
|
|
5024
|
+
ignoreAttributes: false,
|
|
5025
|
+
attributeNamePrefix: "",
|
|
5026
|
+
attributesGroupName: "$",
|
|
5027
|
+
textNodeName: "_",
|
|
5028
|
+
parseTagValue: false,
|
|
5029
|
+
parseAttributeValue: false,
|
|
5030
|
+
trimValues: false,
|
|
5031
|
+
isArray: (_name, jPath, _isLeafNode, isAttribute) => {
|
|
5032
|
+
if (isAttribute) {
|
|
5033
|
+
return false;
|
|
5034
|
+
}
|
|
5035
|
+
// Keep root object shape as xml2js default; force arrays for child elements.
|
|
5036
|
+
return jPath.indexOf(".") !== -1;
|
|
5037
|
+
}
|
|
5038
|
+
});
|
|
5023
5039
|
class JSON_Utils {
|
|
5024
5040
|
static JSONFromXML(xml, onComplete) {
|
|
5025
|
-
|
|
5041
|
+
try {
|
|
5042
|
+
onComplete(null, parser.parse(xml));
|
|
5043
|
+
}
|
|
5044
|
+
catch (error) {
|
|
5045
|
+
onComplete(error, null);
|
|
5046
|
+
}
|
|
5026
5047
|
}
|
|
5027
5048
|
}
|
|
5028
5049
|
|