@byhealth/native-app-jssdk
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
export declare function isApp(): boolean | ""; | ||
export declare function isApp(): boolean; | ||
/** | ||
@@ -13,0 +13,0 @@ * 返回上一级页面,如果没有上一级页面,则关闭当前页面(Android不关闭)。 |
@@ -13,3 +13,3 @@ /** | ||
} | ||
declare const isAppWebview: boolean | ""; | ||
declare const isAppWebview: boolean; | ||
/** | ||
@@ -16,0 +16,0 @@ * Call the app native interface. |
@@ -6,3 +6,3 @@ "use strict"; | ||
var nativeJSBridge = global.MemberAppJs || global.memberApp || {}; | ||
var isAppWebview = global.navigator && global.navigator.userAgent && !!global.navigator.userAgent.match(/byhealth/gi); | ||
var isAppWebview = Boolean(global.navigator && global.navigator.userAgent && global.navigator.userAgent.match(/byhealth/gi)); | ||
exports.isAppWebview = isAppWebview; | ||
@@ -20,5 +20,4 @@ /** | ||
} | ||
var apiFn = nativeJSBridge[api]; | ||
if (typeof apiFn === 'function') { | ||
apiFn.apply(void 0, args); | ||
if (typeof nativeJSBridge[api] === 'function') { | ||
nativeJSBridge[api].apply(nativeJSBridge, args); | ||
} | ||
@@ -25,0 +24,0 @@ else { |
var global = window || {}; | ||
var nativeProtocol = 'js-call://'; | ||
var nativeJSBridge = global.MemberAppJs || global.memberApp || {}; | ||
var isAppWebview = global.navigator && global.navigator.userAgent && !!global.navigator.userAgent.match(/byhealth/gi); | ||
var isAppWebview = Boolean(global.navigator && global.navigator.userAgent && global.navigator.userAgent.match(/byhealth/gi)); | ||
/** | ||
@@ -16,5 +16,4 @@ * Call the app native interface. | ||
} | ||
var apiFn = nativeJSBridge[api]; | ||
if (typeof apiFn === 'function') { | ||
apiFn.apply(void 0, args); | ||
if (typeof nativeJSBridge[api] === 'function') { | ||
nativeJSBridge[api].apply(nativeJSBridge, args); | ||
} | ||
@@ -21,0 +20,0 @@ else { |
{ | ||
"name": "@byhealth/native-app-jssdk", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"description": "By-Health Native App Jssdk.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
71736
1279