File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 33module . exports = u
44
55function u ( type , props , value ) {
6- var node
6+ var node = { type : String ( type ) }
77
8- if (
9- ( value === null || value === undefined ) &&
10- ( typeof props !== 'object' || Array . isArray ( props ) )
11- ) {
8+ if ( value == null && ( typeof props !== 'object' || Array . isArray ( props ) ) ) {
129 value = props
13- props = { }
10+ } else {
11+ Object . assign ( node , props )
1412 }
1513
16- node = Object . assign ( { type : String ( type ) } , props )
17-
1814 if ( Array . isArray ( value ) ) {
1915 node . children = value
20- } else if ( value !== null && value !== undefined ) {
16+ } else if ( value != null ) {
2117 node . value = String ( value )
2218 }
2319
Original file line number Diff line number Diff line change 7272 "esnext" : false ,
7373 "ignore" : [
7474 " types/"
75- ]
75+ ],
76+ "rules" : {
77+ "eqeqeq" : [
78+ " error" ,
79+ " always" ,
80+ {
81+ "null" : " ignore"
82+ }
83+ ],
84+ "no-eq-null" : " off"
85+ }
7686 },
7787 "remarkConfig" : {
7888 "plugins" : [
You can’t perform that action at this time.
0 commit comments