Commit dc2ec02a authored by Maël Nison's avatar Maël Nison

Fix the root() function

parent 86b97f70
......@@ -2,7 +2,7 @@ _ = require 'lodash'
module.exports =
root: ->
return @ if isRoot()
return @ if @isRoot()
return @parent.root()
isRoot: -> @depth() is 0
......@@ -41,4 +41,4 @@ module.exports =
path: (asArray = false) ->
path = @ancestors().map((n) -> n.name).concat([@name])
if asArray then path else path.join('/')
\ No newline at end of file
if asArray then path else path.join('/')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment