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

kitejs

Package Overview
Dependencies
Maintainers
12
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitejs - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

10

lib/consul.js

@@ -9,2 +9,3 @@ "use strict";

function Consul() {
this.useCheckEnv = true;
}

@@ -16,2 +17,5 @@ Consul.prototype.get = function (serAddress, service, callback, env, idc) {

}
if (typeof env !== 'string') {
this.useCheckEnv = false;
}
debug("start_request host: " + serAddress.getHost + " port: " + serAddress.getPort());

@@ -22,3 +26,3 @@ var consul = NConsul({

});
var that = this;
var __this = this;
consul.catalog.service.nodes({

@@ -31,3 +35,3 @@ service: service

nodes.forEach(function (node) {
if (!that.checkEnv(node.ServiceTags, env)) {
if (__this.useCheckEnv && !__this.checkEnv(node.ServiceTags, env)) {
return;

@@ -49,3 +53,3 @@ }

}
return true;
return false;
};

@@ -52,0 +56,0 @@ return Consul;

{
"name": "kitejs",
"version": "1.0.13",
"version": "1.0.14",
"description": "the rpc framework Kite for Node.js",

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

@@ -8,2 +8,4 @@ import {Address} from './protocol/protocol';

export class Consul {
useCheckEnv: boolean = true;
public get(serAddress: Address, service: string, callback, env: string = 'prod', idc ?: string) {

@@ -14,3 +16,8 @@ if (!service) {

if (typeof env !== 'string') {
this.useCheckEnv = false;
}
debug(`start_request host: ${serAddress.getHost} port: ${serAddress.getPort()}`);
const consul = NConsul({

@@ -21,3 +28,3 @@ host: serAddress.getHost(),

var that = this;
var __this = this;

@@ -32,3 +39,3 @@ consul.catalog.service.nodes(

nodes.forEach(node => {
if (!that.checkEnv(node.ServiceTags, env)) {
if (__this.useCheckEnv && !__this.checkEnv(node.ServiceTags, env)) {
return;

@@ -58,3 +65,3 @@ }

return true;
return false;
}

@@ -61,0 +68,0 @@ }

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