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 3
3
var array = require ( 'x-is-array' ) ;
4
4
var object = require ( 'is-object' ) ;
5
5
var proto = require ( 'getprototypeof' ) ;
6
+ var size = require ( 'unist-util-size' ) ;
6
7
7
8
var objectProto = Object . prototype ;
8
9
@@ -287,19 +288,6 @@ function syntheticKey(node) {
287
288
return node . type + ':' + JSON . stringify ( props ) ;
288
289
}
289
290
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
-
303
291
function parent ( value ) {
304
292
return node ( value ) && 'children' in value ;
305
293
}
Original file line number Diff line number Diff line change 20
20
"dependencies" : {
21
21
"getprototypeof" : " ^1.0.0" ,
22
22
"is-object" : " ^1.0.1" ,
23
+ "unist-util-size" : " ^1.0.0" ,
23
24
"x-is-array" : " ^0.1.0"
24
25
},
25
26
"files" : [
You can’t perform that action at this time.
0 commit comments