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

@mpxjs/api-proxy

Package Overview
Dependencies
Maintainers
3
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mpxjs/api-proxy - npm Package Compare versions

Comparing version 2.2.26 to 2.2.27

4

package.json
{
"name": "@mpxjs/api-proxy",
"version": "2.2.26",
"version": "2.2.27",
"description": "convert miniprogram API at each end",

@@ -30,3 +30,3 @@ "module": "src/index.js",

"homepage": "https://github.com/didi/mpx#readme",
"gitHead": "5ed3e9b2b894ac02837d5292cc118c348e4d4a9b"
"gitHead": "e8ff5ca5befcafdf669f97643dd08e6707b93c13"
}

@@ -5,2 +5,10 @@ import { error, getEnvObj } from '../utils'

function genFromMap (platforms = []) {
const result = {}
platforms.forEach((platform) => {
result[`__mpx_src_mode_${platform}__`] = platform
})
return result
}
function transformApi (target, options) {

@@ -14,9 +22,3 @@ const wxToAliApi = getWxToAliApi({ optimize: options.optimize })

}
const platforms = [
'__mpx_srcMode_wx',
'__mpx_srcMode_ali',
'__mpx_srcMode_swan',
'__mpx_srcMode_qq',
'__mpx_srcMode_tt'
]
const fromMap = genFromMap(['wx', 'ali', 'swan', 'qq', 'tt'])

@@ -26,3 +28,3 @@ const envObj = getEnvObj()

function joinName (from = '', to = '') {
return `${from.replace(/^__mpx_srcMode_/, '')}_${to}`
return `${fromMap[from]}_${to}`
}

@@ -45,3 +47,3 @@

if (typeof from !== 'string' || !~platforms.indexOf(from)) {
if (typeof from !== 'string' || !fromMap[from]) {
args.push(from)

@@ -48,0 +50,0 @@ from = options.from

@@ -7,3 +7,3 @@ import { getEnvObj } from './utils'

const list = promisify(envObj, usePromise, whiteList)
const platforms = ['wx', 'ali', 'swan', 'qq', 'tt']
const platforms = ['wx', 'ali', 'swan', 'qq', 'tt'].map(p => `__mpx_src_mode_${p}__`)

@@ -10,0 +10,0 @@ Object.keys(list).forEach(api => {

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