Files
DefinitelyTyped/types
Pete VilterandMohamed Hegazy 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
..
2017-09-18 12:48:28 -07:00
2017-09-26 08:36:27 -07:00
2017-09-25 15:56:55 -07:00
2017-09-22 18:47:58 +02:00
2017-09-15 10:43:31 +02:00
2017-09-16 15:54:53 +02:00
2017-09-25 10:34:14 -04:00
2017-09-15 12:14:51 +08:00
2017-09-14 19:28:40 -07:00
2017-09-25 12:24:53 -07:00
2017-09-15 10:19:28 +09:00
2017-09-19 10:40:03 +03:00
2017-09-26 08:36:27 -07:00
2017-09-16 19:51:01 +03:00
2017-09-19 21:54:54 -04:00
2017-09-18 12:47:56 -07:00
2017-09-23 10:06:33 +08:00
2017-09-26 11:43:03 -07:00
2017-09-25 14:11:48 -07:00
2017-09-19 20:47:01 -06:00
2017-09-22 09:38:21 +02:00
2017-09-20 17:08:01 -04:00
2017-09-25 17:19:11 -07:00
2017-09-21 14:33:28 +02:00
2017-09-15 09:54:30 +10:00
2017-09-19 13:23:50 -04:00
2017-09-14 22:54:49 -05:00
2017-09-18 12:49:16 -07:00
2017-09-19 13:56:48 -03:00
2017-09-25 16:50:24 -07:00
2017-09-26 11:03:43 -07:00
2017-09-18 23:45:12 +02:00
2017-09-20 19:41:24 +02:00
2017-09-19 12:29:52 +02:00
2017-09-21 17:36:05 +02:00
2017-09-15 13:46:03 -04:00