🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

sunmi-bridge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sunmi-bridge - npm Package Compare versions

Comparing version
1.1.0
to
1.2.0
+39
-49
dist/index.js

@@ -1,26 +0,12 @@

var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { UAParser } from 'ua-parser-js';
var SunmiJSBridge = /** @class */ (function () {
function SunmiJSBridge() {
var parser = new UAParser();
SunmiJSBridge.ua = parser.getResult();
SunmiJSBridge.call = SunmiJSBridge.createBridgeCall();
}
SunmiJSBridge.createBridgeCall = function () {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ua_parser_js_1 = require("ua-parser-js");
class SunmiJSBridge {
static createBridgeCall() {
if (!window.webkit && !window.SunmiJSBridge) {
return function () { return null; };
return () => null;
}
return function (fn, arg) {
var message = arg ? JSON.stringify(arg) : '';
var result;
return (fn, arg) => {
const message = arg ? JSON.stringify(arg) : '';
let result;
switch (SunmiJSBridge.ua.os.name) {

@@ -55,35 +41,40 @@ case 'iOS':

};
};
SunmiJSBridge.prototype.log = function (arg) {
}
constructor() {
const parser = new ua_parser_js_1.UAParser();
SunmiJSBridge.ua = parser.getResult();
SunmiJSBridge.call = SunmiJSBridge.createBridgeCall();
}
log(arg) {
SunmiJSBridge.call('log', arg);
};
SunmiJSBridge.prototype.openMiniProgram = function (params) {
SunmiJSBridge.call('openMiniProgram', __assign({}, params));
};
}
openMiniProgram(params) {
SunmiJSBridge.call('openMiniProgram', Object.assign({}, params));
}
// 打开新窗口
SunmiJSBridge.prototype.pushWindow = function (params) {
pushWindow(params) {
SunmiJSBridge.call('pushWindow', params);
};
}
// 打开新窗口
SunmiJSBridge.prototype.pushWindowWithClose = function (params) {
pushWindowWithClose(params) {
SunmiJSBridge.call('pushWindowWithClose', params);
};
}
// 拨打电话
SunmiJSBridge.prototype.callUp = function (phone) {
SunmiJSBridge.call('callUp', { phone: phone });
};
callUp(phone) {
SunmiJSBridge.call('callUp', { phone });
}
// 显示loading
SunmiJSBridge.prototype.showLoading = function (params) {
showLoading(params) {
SunmiJSBridge.call('showLoading', params);
};
SunmiJSBridge.prototype.hideLoading = function () {
}
hideLoading() {
SunmiJSBridge.call('hideLoading');
};
SunmiJSBridge.prototype.showToast = function (params) {
}
showToast(params) {
SunmiJSBridge.call('showToast', params);
};
SunmiJSBridge.prototype.hideToast = function () {
}
hideToast() {
SunmiJSBridge.call('hideToast');
};
SunmiJSBridge.prototype.getUserInfo = function () {
}
getUserInfo() {
switch (SunmiJSBridge.ua.os.name) {

@@ -109,5 +100,4 @@ // iOS兼容

}
};
return SunmiJSBridge;
}());
export { SunmiJSBridge };
}
}
exports.SunmiJSBridge = SunmiJSBridge;
{
"name": "sunmi-bridge",
"version": "1.1.0",
"version": "1.2.0",
"description": "this is a javascript bridge",

@@ -8,3 +8,3 @@ "main": "index.js",

"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
"build": " rm -rf dist/ && tsc"
},

@@ -25,4 +25,3 @@ "repository": {

"ua-parser-js": "^0.7.19"
},
"gitHead": "9836750c32c592e0b16fef5481562e25bd498ede"
}
}
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"moduleResolution": "node",
"module": "esnext",
"module": "none",
"declaration": true,

@@ -7,0 +7,0 @@ "outDir": "./dist",