File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 33var array = require ( 'x-is-array' ) ;
44var object = require ( 'is-object' ) ;
55var proto = require ( 'getprototypeof' ) ;
6+ var size = require ( 'unist-util-size' ) ;
67
78var objectProto = Object . prototype ;
89
@@ -287,19 +288,6 @@ function syntheticKey(node) {
287288 return node . type + ':' + JSON . stringify ( props ) ;
288289}
289290
290- function size ( node ) {
291- var children = node && node . children ;
292- var length = ( children && children . length ) || 0 ;
293- var index = - 1 ;
294- var count = 0 ;
295-
296- while ( ++ index < length ) {
297- count = count + 1 + size ( children [ index ] ) ;
298- }
299-
300- return count ;
301- }
302-
303291function parent ( value ) {
304292 return node ( value ) && 'children' in value ;
305293}
Original file line number Diff line number Diff line change 2020 "dependencies" : {
2121 "getprototypeof" : " ^1.0.0" ,
2222 "is-object" : " ^1.0.1" ,
23+ "unist-util-size" : " ^1.0.0" ,
2324 "x-is-array" : " ^0.1.0"
2425 },
2526 "files" : [
You can’t perform that action at this time.
0 commit comments