UNPKG
snabbdom-to-html
Version:
beta (3.0.0-beta.1)
latest (7.1.0)
7.1.0
7.0.0
6.0.0
5.1.1
5.1.0
5.0.0
4.0.0
3.3.0
3.2.0
3.1.1
3.1.0
3.0.1
3.0.0
3.0.0-beta.1
3.0.0-beta.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
1.0.0
0.1.0
Render Snabbdom Vnodes to HTML strings
github.com/acstll/snabbdom-to-html
acstll/snabbdom-to-html
snabbdom-to-html
/
modules
/
attributes.js
14 lines
(9 loc)
•
277 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var
forOwn =
require
(
'lodash.forown'
)
var
escape
=
require
(
'lodash.escape'
)
// data.attrs
module
.
exports
=
function
attrsModule
(
vnode, attributes
) {
var
attrs = vnode.
data
.
attrs
|| {}
forOwn
(attrs,
function
(
value, key
) { attributes.
set
(key,
escape
(value)) }) }