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

@tride/gojek-handler

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tride/gojek-handler - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

28

index.js
const axios = require("axios");
const ms = require("ms");
const Handler = require("@tride/basic-handler");
const handleError = err => new Promise((_, reject) => reject(err));
const authenticate = (userData, actual = false) => {

@@ -66,4 +65,5 @@ let body = {

class GojekHandler {
class GojekHandler extends Handler {
constructor(config) {
super(config);
this.token = config && config.token;

@@ -82,20 +82,2 @@ this.Authorization = `Bearer ${this.token}`;

}
handleRequest(config) {
return new Promise((resolve, reject) => {
this.request(config)
.then(({ data }) => {
data.service = "gojek";
resolve(data);
})
.catch(err => {
let errData;
if (err.response && err.response.data) {
errData = err.response.data;
} else {
errData = err.toString();
}
reject(errData);
});
});
}

@@ -174,3 +156,3 @@ getMotorBikePrice(start, end, actual = false) {

if (!orderNo) {
handleError("No order found");
this.handleError(new Error("No order found"));
}

@@ -232,3 +214,3 @@

if (!orderNo) {
handleError("No Order Number Given");
this.handleError(new Error("No Order Number Given"));
}

@@ -235,0 +217,0 @@

3

package.json
{
"name": "@tride/gojek-handler",
"version": "1.0.2",
"version": "1.0.3",
"description": "Gojek Handler",

@@ -21,2 +21,3 @@ "main": "index.js",

"dependencies": {
"@tride/basic-handler": "^0.0.0",
"axios": "^0.17.0",

@@ -23,0 +24,0 @@ "ms": "^2.0.0",

@@ -15,4 +15,5 @@ import test from "ava";

test("Class", t => {
test("Class", async t => {
let g = new Gojek();
// await g.rideStatus();
t.is(g instanceof Gojek, true);

@@ -19,0 +20,0 @@ });

Sorry, the diff of this file is not supported yet

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