mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-07-16 00:00:04 +08:00
chore(decorators): do not check method name on instancecheck
This commit is contained in:
@@ -119,7 +119,7 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
|
||||
return (pluginObj: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
|
||||
return {
|
||||
value: function(...args: any[]): any {
|
||||
if (instanceAvailability(pluginObj, methodName)) {
|
||||
if (instanceAvailability(pluginObj)) {
|
||||
return descriptor.value.apply(this, args);
|
||||
} else {
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
|
||||
* Checks if _objectInstance exists and has the method/property
|
||||
* @private
|
||||
*/
|
||||
export function instanceAvailability(pluginObj: any, methodName: string): boolean {
|
||||
return pluginObj._objectInstance && pluginObj._objectInstance[methodName] !== 'undefined';
|
||||
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
|
||||
return pluginObj._objectInstance && (!methodName || pluginObj._objectInstance[methodName] !== 'undefined');
|
||||
}
|
||||
|
||||
function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
|
||||
|
||||
Reference in New Issue
Block a user