-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (30 loc) · 729 Bytes
/
index.js
File metadata and controls
41 lines (30 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Fragment = exports["default"] = void 0;
/**
* jsx-runtime 返回的 结果是 {safeHTML:'**'} 的结构
* @param obj
* @returns {string|string|*}
*/
function jsx2string(obj) {
if (!obj) {
return '';
} // 普通对象
if (typeof obj.safeHTML === 'string') {
return obj.safeHTML;
} // 如果是数组
if (obj instanceof Array) {
var result = '';
for (var i = 0, len = obj.length; i < len; i++) {
result += jsx2string(obj[i]);
}
return result;
}
return obj;
}
var _default = jsx2string; // 空标签
exports["default"] = _default;
var Fragment = "Fragment";
exports.Fragment = Fragment;