git ssb

1+

Matt McKegg / pull-hyperscript



Commit 09ff6859d5f3bbe1d6d1bb575c6d2cf7e546c031

Work without destructuring assignment

Support node v5
cel committed on 10/22/2016, 8:37:40 PM
Parent: 2be98937cd98f834eb1c89fd7cc15df13c8b2acb

Files changed

index.jschanged
index.jsView
@@ -7,19 +7,14 @@
77 var createAttributes = require('./lib/create-attributes')
88
99 module.exports = h
1010
11-function h () {
12- var tagName, props, children
13- if (arguments.length === 3) [ tagName, props, children ] = arguments
14-
15- if (arguments.length === 2) {
16- if (isChild(arguments[1])) [ tagName, children ] = arguments
17- else [ tagName, props, children ] = arguments
11 +function h (tagName, props, children) {
12 + if (arguments.length === 2 && isChild(props)) {
13 + children = props
14 + props = undefined
1815 }
1916
20- if (arguments.length === 1) [ tagName ] = arguments
21-
2217 props = defined(props, {})
2318 // children = defined(children, [])
2419
2520 return cat([

Built with git-ssb-web