mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-29 12:40:34 +08:00
Optional callback is different definition + writing tests
This commit is contained in:
1 parent
5d90e28c18
commit
78b5a657f9
2 files changed
+50
-36
No files matched your search
+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