allow non-array args
This commit is contained in:
parent
b59c919733
commit
9cf63c2cfa
|
@ -246,23 +246,39 @@ class Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a module using properties on it's prototype.
|
* Finds the first module using properties on it's prototype.
|
||||||
* @param {Array} props Properties to use to filter modules
|
* @param {any} props Properties to use to filter modules
|
||||||
* @param {Boolean} first Whether to return only the first matching module
|
|
||||||
* @return {Any}
|
* @return {Any}
|
||||||
*/
|
*/
|
||||||
static byPrototypes(prototypes, first = true) {
|
static byPrototypes(...prototypes) {
|
||||||
return this.getModule(Filters.byPrototypeFields(prototypes), first);
|
return this.getModule(Filters.byPrototypeFields(prototypes), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a module using it's own properties.
|
* Finds all modules using properties on it's prototype.
|
||||||
* @param {Array} props Properties to use to filter modules
|
* @param {any} props Properties to use to filter modules
|
||||||
* @param {Boolean} first Whether to return only the first matching module
|
|
||||||
* @return {Any}
|
* @return {Any}
|
||||||
*/
|
*/
|
||||||
static byProps(props, first = true) {
|
static allbyPrototypes(...prototypes) {
|
||||||
return this.getModule(Filters.byProperties(props), first);
|
return this.getModule(Filters.byPrototypeFields(prototypes), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the first module using it's own properties.
|
||||||
|
* @param {any} props Properties to use to filter modules
|
||||||
|
* @return {Any}
|
||||||
|
*/
|
||||||
|
static byProps(...props) {
|
||||||
|
return this.getModule(Filters.byProperties(props), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds all modules using it's own properties.
|
||||||
|
* @param {any} props Properties to use to filter modules
|
||||||
|
* @return {Any}
|
||||||
|
*/
|
||||||
|
static allByProps(...props) {
|
||||||
|
return this.getModule(Filters.byProperties(props), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue