🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

push-huawei

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

push-huawei - npm Package Compare versions

Comparing version

to
0.2.4

10

lib/push-huawei.js

@@ -6,3 +6,2 @@ const axios = require('axios');

const cache = {};
class Huawei {

@@ -21,2 +20,3 @@ constructor(options = {}) {

this.options = options;
this.cache = {};
}

@@ -141,4 +141,4 @@

async getToken() {
if (cache.access_token && cache.time - new Date().getTime() > 0) {
return { access_token: cache.access_token }
if (this.cache.access_token && this.cache.time - new Date().getTime() > 0) {
return { access_token: this.cache.access_token }
}

@@ -157,4 +157,4 @@ const res = await axios({

if(res.data.access_token){
cache.access_token = res.data.access_token;
cache.time = new Date().getTime() + (res.data.expires_in * 1000);
this.cache.access_token = res.data.access_token;
this.cache.time = new Date().getTime() + (res.data.expires_in * 1000);
}

@@ -161,0 +161,0 @@

{
"name": "push-huawei",
"version": "0.2.3",
"version": "0.2.4",
"description": "push-huawei",

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