Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 7e82ee2

Browse files
committed
Add symbol property to routes to check instance
1 parent 5dbf283 commit 7e82ee2

4 files changed

Lines changed: 226 additions & 60 deletions

File tree

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* }
2727
*/
2828

29+
export const isCreateRestInstance = Symbol('isCreateRestInstance')
30+
2931
/**
3032
* @desc Routes object
3133
* @typedef {object} RestRoutes Foo bar
@@ -60,7 +62,7 @@ export class Maker {
6062
Object.keys(this.ctx.scoped).forEach(name => {
6163
scoped[name] = this.ctx.scoped[name].build()
6264
})
63-
return Object.assign({}, this.ctx, { scoped })
65+
return Object.assign({}, this.ctx, { scoped, [isCreateRestInstance]: true })
6466
}
6567

6668
/**

0 commit comments

Comments
 (0)