chore(decorators): do not check method name on instancecheck

This commit is contained in:
Ibby
2017-03-14 18:25:23 -04:00
parent 56263e13fe
commit b704d2875b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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 {