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

nats

Package Overview
Dependencies
Maintainers
3
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats - npm Package Compare versions

Comparing version 2.12.0 to 2.12.1

29

lib/nats-base-client/kv.js

@@ -404,3 +404,30 @@ "use strict";

create(k, data) {
return this.put(k, data, { previousSeq: 0 });
var _a;
return __awaiter(this, void 0, void 0, function* () {
let firstErr;
try {
const n = yield this.put(k, data, { previousSeq: 0 });
return Promise.resolve(n);
}
catch (err) {
firstErr = err;
if (((_a = err === null || err === void 0 ? void 0 : err.api_error) === null || _a === void 0 ? void 0 : _a.err_code) !== 10071) {
return Promise.reject(err);
}
}
let rev = 0;
try {
const e = yield this.get(k);
if ((e === null || e === void 0 ? void 0 : e.operation) === "DEL" || (e === null || e === void 0 ? void 0 : e.operation) === "PURGE") {
rev = e !== null ? e.revision : 0;
return this.update(k, data, rev);
}
else {
return Promise.reject(firstErr);
}
}
catch (err) {
return Promise.reject(err);
}
});
}

@@ -407,0 +434,0 @@ update(k, data, version) {

@@ -39,7 +39,16 @@ "use strict";

const c = require("crypto");
// this will patch to undefined if webcrypto is not available (node 14)
// views will toss if crypto is not available
global.crypto = c.webcrypto;
}
if (typeof globalThis.ReadableStream === "undefined") {
const streams = require("web-streams-polyfill/ponyfill");
global.ReadableStream = streams.ReadableStream;
// @ts-ignore: node global
const chunks = process.versions.node.split(".");
const v = parseInt(chunks[0]);
if (v >= 16) {
// this won't mess up fetch
const streams = require("stream/web");
// views will toss if ReadableStream is not available
global.ReadableStream = streams.ReadableStream;
}
}

@@ -46,0 +55,0 @@ var connect_1 = require("./connect");

2

lib/src/node_transport.js

@@ -46,3 +46,3 @@ "use strict";

const dns = require("dns");
const VERSION = "2.12.0";
const VERSION = "2.12.1";
const LANG = "nats.js";

@@ -49,0 +49,0 @@ class NodeTransport {

{
"name": "nats",
"version": "2.12.0",
"version": "2.12.1",
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system",

@@ -43,3 +43,3 @@ "keywords": [

"clean": "shx rm -Rf ./lib/* ./nats-base-client ./.deps",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.12.0 https://github.com/nats-io/nats.deno.git",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.12.1 https://github.com/nats-io/nats.deno.git",
"fmt": "deno fmt ./src/ ./examples/ ./test/",

@@ -61,4 +61,3 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run check-package && npm run build",

"dependencies": {
"nkeys.js": "1.0.5",
"web-streams-polyfill": "^3.2.1"
"nkeys.js": "1.0.5"
},

@@ -65,0 +64,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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