-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
44 lines (34 loc) · 928 Bytes
/
index.js
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
42
43
44
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _htmlTags = _interopRequireDefault(require("html-tags"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let omit = (keys, obj) => {
let obj2 = {};
for (let key of Object.keys(obj)) {
if (!keys.includes(key)) {
obj2[key] = obj[key];
}
}
return obj2;
};
let Safe = _htmlTags.default.reduce((tags, tag) => {
tags[tag] = class Tag extends _react.default.Component {
render() {
let {
props
} = this;
return _react.default.createElement(tag, Object.assign(omit(["children"], props), {
dangerouslySetInnerHTML: {
__html: props.children
}
}));
}
};
return tags;
}, {});
var _default = Safe;
exports.default = _default;