New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hylid/call

Package Overview
Dependencies
Maintainers
0
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hylid/call - npm Package Compare versions

Comparing version 4.0.7 to 4.0.8-alpha.1

10

lib/mpWebCall.js

@@ -12,2 +12,3 @@ var __assign = this && this.__assign || function () {

import { mpWebOnMessage, mpWebPostMessage } from "./mpWebBridge";
import { createError } from "./utils";
import { alipayJSBridge } from "./webCall";

@@ -75,2 +76,11 @@ // 关联 postMessage 和 onMessage,根据 serialId 执行回调

mpWebPostMessage(message);
// 设置 jsapi 通信超时时间
var _options = options;
if ((config === null || config === void 0 ? void 0 : config.timeout) && (_options === null || _options === void 0 ? void 0 : _options.fail)) {
setTimeout(function () {
if (!callMap[serialId]) return;
delete callMap[serialId];
_options.fail(createError('TIMEOUT'));
}, config.timeout);
}
}

@@ -77,0 +87,0 @@ function broadcastGlobalData(key, result) {

2

lib/types.d.ts

@@ -10,3 +10,3 @@ import { JsApiType, MPApi, PickMPArgs, PickMpReturns } from '@hylid/types';

/**
* timeout 配置,单位 ms
* 套壳 jsapi 调用,通信超时时间。type = "callback" 时不生效
*/

@@ -13,0 +13,0 @@ timeout?: number;

@@ -23,2 +23,6 @@ import { MpWebMessageResult } from './types';

};
TIMEOUT: {
code: number;
message: (name: string) => string;
};
};

@@ -25,0 +29,0 @@ export declare const createError: (type: keyof typeof ERROR, name?: string) => {

@@ -31,2 +31,8 @@ var ERROR = {

}
},
TIMEOUT: {
code: -6,
message: function message(name) {
return "".concat(name, " exec fail, timeout");
}
}

@@ -33,0 +39,0 @@ };

{
"name": "@hylid/call",
"version": "4.0.7",
"version": "4.0.8-alpha.1",
"main": "lib/index.js",

@@ -9,4 +9,4 @@ "files": [

"dependencies": {
"@hylid/env": "^4.0.7",
"@hylid/types": "^4.0.7"
"@hylid/env": "^4.0.8-alpha.1",
"@hylid/types": "^4.0.8-alpha.1"
},

@@ -13,0 +13,0 @@ "publishConfig": {

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