{"action":"created","issue":{"url":"https://api.github.com/repos/RubyLouvre/anu/issues/41","repository_url":"https://api.github.com/repos/RubyLouvre/anu","labels_url":"https://api.github.com/repos/RubyLouvre/anu/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/RubyLouvre/anu/issues/41/comments","events_url":"https://api.github.com/repos/RubyLouvre/anu/issues/41/events","html_url":"https://github.com/RubyLouvre/anu/issues/41","id":253893248,"number":41,"title":"createElement应该与官方一致","user":{"login":"RubyLouvre","id":190846,"avatar_url":"https://avatars3.githubusercontent.com/u/190846?v=4","gravatar_id":"","url":"https://api.github.com/users/RubyLouvre","html_url":"https://github.com/RubyLouvre","followers_url":"https://api.github.com/users/RubyLouvre/followers","following_url":"https://api.github.com/users/RubyLouvre/following{/other_user}","gists_url":"https://api.github.com/users/RubyLouvre/gists{/gist_id}","starred_url":"https://api.github.com/users/RubyLouvre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubyLouvre/subscriptions","organizations_url":"https://api.github.com/users/RubyLouvre/orgs","repos_url":"https://api.github.com/users/RubyLouvre/repos","events_url":"https://api.github.com/users/RubyLouvre/events{/privacy}","received_events_url":"https://api.github.com/users/RubyLouvre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-30T06:38:46Z","updated_at":"2017-08-30T09:20:29Z","closed_at":null,"author_association":"OWNER","body":"```javascript\r\nfunction flattenChildren(stack) {\r\n    var lastText,\r\n        child,\r\n        hasText = false,\r\n        children = [];\r\n\r\n    while (stack.length) {\r\n        //比较巧妙地判定是否为子数组\r\n        if ((child = stack.pop()) && child.pop) {\r\n            if (child.toJS) {\r\n                //兼容Immutable.js\r\n                child = child.toJS();\r\n            }\r\n            for (let i = 0; i < child.length; i++) {\r\n                stack[stack.length] = child[i];\r\n            }\r\n        } else {\r\n            // eslint-disable-next-line\r\n            var childType = typeNumber(child);\r\n\r\n            if (childType < 3 // 0, 1, 2\r\n            ) {\r\n                continue;\r\n            }\r\n\r\n            if (childType < 6) {\r\n                //!== 'object' 不是对象就是字符串或数字\r\n                if (hasText) {\r\n                    lastText = children[0] = child + lastText;\r\n                    continue;\r\n                }\r\n                child = child + \"\"\r\n                lastText = child\r\n                hasText = true\r\n            } else {\r\n                hasText = lastText = null;\r\n            }\r\n\r\n            children.unshift(child);\r\n        }\r\n    }\r\n    if (!children.length) {\r\n        children = EMPTY_CHILDREN;\r\n    }\r\n    return children;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/RubyLouvre/anu/issues/comments/325934063","html_url":"https://github.com/RubyLouvre/anu/issues/41#issuecomment-325934063","issue_url":"https://api.github.com/repos/RubyLouvre/anu/issues/41","id":325934063,"user":{"login":"RubyLouvre","id":190846,"avatar_url":"https://avatars3.githubusercontent.com/u/190846?v=4","gravatar_id":"","url":"https://api.github.com/users/RubyLouvre","html_url":"https://github.com/RubyLouvre","followers_url":"https://api.github.com/users/RubyLouvre/followers","following_url":"https://api.github.com/users/RubyLouvre/following{/other_user}","gists_url":"https://api.github.com/users/RubyLouvre/gists{/gist_id}","starred_url":"https://api.github.com/users/RubyLouvre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubyLouvre/subscriptions","organizations_url":"https://api.github.com/users/RubyLouvre/orgs","repos_url":"https://api.github.com/users/RubyLouvre/repos","events_url":"https://api.github.com/users/RubyLouvre/events{/privacy}","received_events_url":"https://api.github.com/users/RubyLouvre/received_events","type":"User","site_admin":false},"created_at":"2017-08-30T09:20:29Z","updated_at":"2017-08-30T09:20:29Z","author_association":"OWNER","body":"```javascript\r\nfunction normalizeChildren(props) {\r\n    var children = props.children\r\n    if (children === void 666) {\r\n        return EMPTY_CHILDREN\r\n    }\r\n    if (!Array.isArray(children)) {\r\n        children = [children]\r\n    }\r\n    return props.children = children.map(function (el) {\r\n        if (el === null) {\r\n            return {\r\n                vtype: 0,\r\n                type: '#empty',\r\n                text: 'empty'\r\n            }\r\n        }\r\n        if (typeof el === 'string') {\r\n            return {\r\n                vtype: 0,\r\n                type: '#text',\r\n                text: el\r\n            }\r\n        }\r\n        return el\r\n    })\r\n}\r\n```"}}
{"actor":{"display_login":"RubyLouvre"}}