DefinitelyTyped/types/dagre
Pete Vilter d2260fff79 Fix dagre types to allow objects to be set as default edge labels (#19945)
The tests call `.setDefaultEdgeLabel(() => {})` which is a translation
to ES6 of something seen in the example in [Dagre's
readme](https://github.com/cpettitt/dagre/wiki#an-example-layout):
`g.setDefaultEdgeLabel(function() { return {}; });`. However, the
translation is botched: `() => {}` doesn't return an empty object, it
returns `undefined`, because `{}` is not an object literal, it's a
block with 0 statements.

I think this is what motivated the current typing to specify that `void`
can be returned by the callback. However, in my experience returning
`undefined` from this callback causes the library to crash. Thus I've
chagned the tests to say `.setDefaultEdgeLabel(() => ({}))` (i.e.
actually return an empty object, which is what the author probably
intended), and updated the types accordingly. This works in my project.
2017-09-26 15:50:00 -07:00
..
dagre-tests.ts Fix dagre types to allow objects to be set as default edge labels (#19945) 2017-09-26 15:50:00 -07:00
index.d.ts Fix dagre types to allow objects to be set as default edge labels (#19945) 2017-09-26 15:50:00 -07:00
tsconfig.json
tslint.json