@byhealth/native-app-jssdk
Advanced tools
Comparing version 2.4.0-beta.1 to 2.4.0-beta.2
@@ -13,2 +13,9 @@ import { ShareInfo, UserInfo, NewUserInfo } from './types/MemberAppJs'; | ||
/** | ||
* 判断最低版本 | ||
* @param android Android端 最低版本 | ||
* @param ios iOS端 最低版本 | ||
* @returns {Promise<string>} 返回当前版本,iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
export declare function minVersion(android: string, ios: string): Promise<string>; | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -15,0 +22,0 @@ */ |
"use strict"; | ||
/* | ||
* BY-Health Front-end Team (https://www.by-health.com/) | ||
* | ||
* Copyright © 2016-present By-Health Co Ltd. All rights reserved. | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -18,2 +13,8 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
* BY-Health Front-end Team (https://www.by-health.com/) | ||
* | ||
* Copyright © 2016-present By-Health Co Ltd. All rights reserved. | ||
*/ | ||
var compare_versions_1 = __importDefault(require("compare-versions")); | ||
var createCallback_1 = __importDefault(require("./lib/createCallback")); | ||
@@ -41,2 +42,19 @@ var nativeBridge_1 = __importStar(require("./lib/nativeBridge")); | ||
/** | ||
* 判断最低版本 | ||
* @param android Android端 最低版本 | ||
* @param ios iOS端 最低版本 | ||
* @returns {Promise<string>} 返回当前版本,iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
function minVersion(android, ios) { | ||
return getVersion().then(function (currentVersion) { | ||
var _a = currentVersion.split(','), current = _a[1]; | ||
var minimum = nativeBridge_1.isAndroid ? android : ios; | ||
if (compare_versions_1.default(current, minimum) < 0) { | ||
return Promise.reject(new RangeError("\u5F53\u524DApp\u7248\u672C\u4E0D\u652F\u6301\uFF0C\u8BF7\u66F4\u65B0App\u7248\u672C\u5230 " + minimum + " \u4EE5\u4E0A\u3002")); | ||
} | ||
return currentVersion; | ||
}); | ||
} | ||
exports.minVersion = minVersion; | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -43,0 +61,0 @@ */ |
@@ -6,2 +6,3 @@ /* | ||
*/ | ||
import compareVersions from 'compare-versions'; | ||
import createCallback from './lib/createCallback'; | ||
@@ -26,2 +27,18 @@ import nativeBridge, { isAppWebview, isAndroid } from './lib/nativeBridge'; | ||
/** | ||
* 判断最低版本 | ||
* @param android Android端 最低版本 | ||
* @param ios iOS端 最低版本 | ||
* @returns {Promise<string>} 返回当前版本,iOS,4.1.0 或者 Android,4.1.0 | ||
*/ | ||
export function minVersion(android, ios) { | ||
return getVersion().then(function (currentVersion) { | ||
var _a = currentVersion.split(','), current = _a[1]; | ||
var minimum = isAndroid ? android : ios; | ||
if (compareVersions(current, minimum) < 0) { | ||
return Promise.reject(new RangeError("\u5F53\u524DApp\u7248\u672C\u4E0D\u652F\u6301\uFF0C\u8BF7\u66F4\u65B0App\u7248\u672C\u5230 " + minimum + " \u4EE5\u4E0A\u3002")); | ||
} | ||
return currentVersion; | ||
}); | ||
} | ||
/** | ||
* 返回上一级页面,如果没有上一级页面,则关闭当前页面。 | ||
@@ -28,0 +45,0 @@ */ |
{ | ||
"name": "@byhealth/native-app-jssdk", | ||
"version": "2.4.0-beta.1", | ||
"version": "2.4.0-beta.2", | ||
"description": "By-Health Native App Jssdk.", | ||
@@ -21,3 +21,5 @@ "main": "dist/index.js", | ||
], | ||
"dependencies": {}, | ||
"dependencies": { | ||
"compare-versions": "^3.5.1" | ||
}, | ||
"devDependencies": { | ||
@@ -24,0 +26,0 @@ "@types/node": "^12.7.12", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87010
1972
1
+ Addedcompare-versions@^3.5.1
+ Addedcompare-versions@3.6.0(transitive)