Socket
Socket
Sign inDemoInstall

promisify-wx

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

39

index.js

@@ -43,17 +43,2 @@ const APIs = [

const EVENTs = [
'socketOpen',
'socketError',
'socketMessage',
'socketClose',
'backgroundAudioPlay',
'backgroundAudioPause',
'backgroundAudioStop',
'accelerometerChange',
'compassChange'
];
const PROXYs = [

@@ -63,4 +48,13 @@ 'connectSocket',

'closeSocket',
'onSocketOpen',
'onSocketError',
'onSocketMessage',
'onSocketClose',
'createAudioContext',
'createVideoContext',
'onBackgroundAudioPlay',
'onBackgroundAudioPause',
'onBackgroundAudioStop',
'onAccelerometerChange',
'onCompassChange',
'createAnimation',

@@ -74,7 +68,2 @@ 'createContext',

function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
let promisifyWx = {};

@@ -87,3 +76,3 @@

options.fail = reject;
wx[api].call(options);
wx[api].call(wx, options);
})

@@ -93,11 +82,5 @@ }

promisifyWx.on = function(eventId, callback) {
if (EVENTs.indexOf(eventId) > -1) {
wx[`on${capitalizeFirstLetter(eventId)}`].call(callback);
}
};
PROXYs.map((proxyApi) => {
promisifyWx[proxyApi] = function(options) {
return wx[proxyApi].call(options);
return wx[proxyApi].call(wx, options);
}

@@ -104,0 +87,0 @@ });

{
"name": "promisify-wx",
"version": "0.1.0",
"version": "0.2.0",
"description": "promisify wx api ",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc