mm_expand 2.4.3 → 2.4.4
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/lib/string.js +2 -1
- package/package.json +2 -2
package/lib/string.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const json5 = require('json5');
|
|
5
5
|
const pinyin = require('pinyinlite');
|
|
6
6
|
const { createHash, createCipheriv, createDecipheriv } = require('crypto');
|
|
7
|
+
const { XMLParser } = require('fast-xml-parser');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* form-data转对象
|
|
@@ -132,7 +133,7 @@ String.prototype.toJson = function () {
|
|
|
132
133
|
*/
|
|
133
134
|
String.prototype.toXml = function () {
|
|
134
135
|
try {
|
|
135
|
-
const parser = new
|
|
136
|
+
const parser = new XMLParser();
|
|
136
137
|
return parser.parse(this);
|
|
137
138
|
} catch (error) {
|
|
138
139
|
throw new Error('xml反序列化错误: ' + error.message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_expand",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "超级美眉原型函数扩展模块 - 增强的字符串、数组、对象、日期操作,具备错误预防功能并简化业务逻辑",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"eslint": "^10.6.0",
|
|
49
|
-
"eslint-plugin-jsdoc": "^63.0.
|
|
49
|
+
"eslint-plugin-jsdoc": "^63.0.12",
|
|
50
50
|
"mm_eslint": "^1.7.5"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|