Comparing version 2.11.0 to 2.12.0
import { ConsumerConfig, Msg, Nanos } from "./types"; | ||
import { NatsError } from "./error"; | ||
export declare function validateDurableName(name?: string): void; | ||
export declare function validateStreamName(name?: string): void; | ||
export declare function validateDurableName(name?: string): string; | ||
export declare function validateStreamName(name?: string): string; | ||
export declare function validateName(context: string, name?: string): void; | ||
@@ -6,0 +6,0 @@ export declare function validName(name?: string): string; |
@@ -5,3 +5,3 @@ "use strict"; | ||
/* | ||
* Copyright 2021-2022 The NATS Authors | ||
* Copyright 2021-2023 The NATS Authors | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
@@ -24,9 +24,22 @@ * you may not use this file except in compliance with the License. | ||
function validateDurableName(name) { | ||
return validateName("durable", name); | ||
return minValidation("durable", name); | ||
} | ||
exports.validateDurableName = validateDurableName; | ||
function validateStreamName(name) { | ||
return validateName("stream", name); | ||
return minValidation("stream", name); | ||
} | ||
exports.validateStreamName = validateStreamName; | ||
function minValidation(context, name = "") { | ||
// minimum validation on streams/consumers matches nats cli | ||
if (name === "") { | ||
throw Error(`${context} name required`); | ||
} | ||
const bad = [".", "*", ">", "/", "\\"]; | ||
bad.forEach((v) => { | ||
if (name.indexOf(v) !== -1) { | ||
throw Error(`invalid ${context} name - ${context} name cannot contain '${v}'`); | ||
} | ||
}); | ||
return ""; | ||
} | ||
function validateName(context, name = "") { | ||
@@ -33,0 +46,0 @@ if (name === "") { |
@@ -46,3 +46,3 @@ "use strict"; | ||
const dns = require("dns"); | ||
const VERSION = "2.11.0"; | ||
const VERSION = "2.12.0"; | ||
const LANG = "nats.js"; | ||
@@ -49,0 +49,0 @@ class NodeTransport { |
{ | ||
"name": "nats", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"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.11.0 https://github.com/nats-io/nats.deno.git", | ||
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.12.0 https://github.com/nats-io/nats.deno.git", | ||
"fmt": "deno fmt ./src/ ./examples/ ./test/", | ||
@@ -61,14 +61,14 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run check-package && npm run build", | ||
"dependencies": { | ||
"nkeys.js": "1.0.4", | ||
"nkeys.js": "1.0.5", | ||
"web-streams-polyfill": "^3.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.11.18", | ||
"ava": "^5.1.0", | ||
"@types/node": "^18.13.x", | ||
"ava": "^5.2.x", | ||
"minimist": "^1.2.7", | ||
"nats-jwt": "^0.0.3-1", | ||
"nats-jwt": "^0.0.5", | ||
"nyc": "^15.1.0", | ||
"shx": "^0.3.3", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.9.x" | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -75,0 +75,0 @@ "typings": "./lib/src/mod.d.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
947147
16341
+ Addednkeys.js@1.0.5(transitive)
- Removednkeys.js@1.0.4(transitive)
Updatednkeys.js@1.0.5