Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fc901b3ec | |||
| 50e0cf3090 | |||
| d245d15ad6 | |||
| 265837b5cd |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@extollo/lib",
|
||||
"version": "0.5.10",
|
||||
"version": "0.5.12",
|
||||
"description": "The framework library that lifts up your code.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
||||
@@ -194,7 +194,15 @@ export abstract class Model<T extends Model<T>> extends AppClass implements Bus
|
||||
}
|
||||
}
|
||||
|
||||
builder.withScopes(this.prototype.scopes)
|
||||
if ( this.prototype.scopes ) {
|
||||
// Same thing here. Try to get the scopes statically, if possible
|
||||
builder.withScopes(this.prototype.scopes)
|
||||
} else if ( this.constructor.length < 1 ) {
|
||||
// Otherwise, try to instantiate the model if possible and load the scopes that way
|
||||
const inst = Container.getContainer().make<Model<any>>(this)
|
||||
builder.withScopes(inst.scopes)
|
||||
}
|
||||
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ export class AsyncCollection<T> {
|
||||
await this.each(async (item, index) => {
|
||||
const result = await func(item, index)
|
||||
if ( typeof result !== 'undefined' ) {
|
||||
newItems.push(result as NonNullable<T2>)
|
||||
newItems.push(result as unknown as NonNullable<T2>)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user