Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@byhealth/native-app-jssdk

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byhealth/native-app-jssdk - npm Package Compare versions

Comparing version 2.4.0-beta.1 to 2.4.0-beta.2

7

dist/index.d.ts

@@ -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 @@ */

28

dist/index.js
"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 @@ */

6

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc