mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Optional callback is different definition + writing tests
This commit is contained in:
+8
-1
@@ -23,9 +23,16 @@ plugin.register.attributes = {
|
||||
|
||||
// optional options parameter
|
||||
server.register({}, function (err) {});
|
||||
// optional callback function with and without options
|
||||
server.register({}).then((res: any) => {
|
||||
console.log(res);
|
||||
});
|
||||
server.register({}, { select: "api", routes: { prefix: "/prefix" } }).then((res: any) => {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
// optional options.routes.vhost parameter
|
||||
server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, function (err) {});
|
||||
server.register({}, { select: "api", routes: { prefix: "/prefix" } }, function (err) {});
|
||||
|
||||
//server.pack.register(plugin, (err: Object) => {
|
||||
// if (err) { throw err; }
|
||||
|
||||
Reference in New Issue
Block a user