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

@weex-project/downgrade

Package Overview
Dependencies
Maintainers
11
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weex-project/downgrade

Weex downgrade to Web module

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
11
Weekly downloads
 
Created
Source

Downgrade module

Weex downgrade to web module. Version should be semver format.

install

install from npm command: npm install @weex-project/downgrade --save

sample

import Downgrade from '@weex-project/downgrade'

// force downgrade
Downgrade.force()

/*
    check condition. When match anyone condition will return downgrade is true. return format as below:
    {
        isDowngrade: true,
        errorType: 1,
        code: 1000,
        errorMessage: 'XXXXXXXX'
    }
*/
Downgrade.check({
    ios: {
        osVersion: '>1.0',
        appVersion: '>1.0.0',
        weexVersion: '>1',
        deviceModel: ['iPhone5,1']
    },
    android: {
        osVersion: '>1.0',
        appVersion: '>1.0.0',
        weexVersion: '>1',
        deviceModel: ['G-2PW2100']
    }
})

// check condition with multiple app. The `MY_APP_A` is WXEnvironment's appName param.
Downgrade.check({
    ios: {
        osVersion: '>1.0',
        appVersion: {
            MY_APP_A: '>1.0.0',
            MY_APP_B: '>2.0.0'
        },
        weexVersion: '>1',
        deviceModel: ['iPhone5,1']
    },
    android: {
        osVersion: '>1.0',
        appVersion: {
            MY_APP_A: '>1.0.0',
            MY_APP_C: '>3.0.0'
        },
        weexVersion: '>1',
        deviceModel: ['G-2PW2100']
    }
})

// When match condition will auto downgrade to web
Downgrade.condition({
    ios: {
        osVersion: '>1.0',
        appVersion: '>1.0.0',
        weexVersion: '>1',
        deviceModel: ['iPhone5,1']
    },
    android: {
        osVersion: '>1.0',
        appVersion: '>1.0.0',
        weexVersion: '>1',
        deviceModel: ['G-2PW2100']
    }
})

// When condition with multiple app. The `MY_APP_A` is WXEnvironment's appName param.
Downgrade.condition({
    ios: {
        osVersion: '>1.0',
        appVersion: {
            MY_APP_A: '>1.0.0',
            MY_APP_B: '>2.0.0'
        },
        weexVersion: '>1',
        deviceModel: ['iPhone5,1']
    },
    android: {
        osVersion: '>1.0',
        appVersion: {
            MY_APP_A: '>1.0.0',
            MY_APP_C: '>3.0.0'
        },
        weexVersion: '>1',
        deviceModel: ['G-2PW2100']
    }
})

Keywords

FAQs

Package last updated on 22 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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