@sebspark/pubsub
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -30,3 +30,2 @@ "use strict"; | ||
var import_pubsub = require("@google-cloud/pubsub"); | ||
var import_avsc = require("avsc"); | ||
var schemaIdPattern = /^(?!goog)[a-zA-Z][a-zA-Z0-9-._~%+]{2,254}$/; | ||
@@ -71,3 +70,2 @@ var syncTopicSchema = async (client, cloudSchema) => { | ||
let _topic; | ||
let _type; | ||
const ensureInitiated = async (name, schema) => { | ||
@@ -81,6 +79,2 @@ if (!_topic) { | ||
} | ||
if (schema && !_type) { | ||
const schemaType = import_avsc.Type.forSchema(JSON.parse(schema.avroDefinition)); | ||
_type = schemaType; | ||
} | ||
}; | ||
@@ -95,8 +89,3 @@ const typedClient = { | ||
await ensureInitiated(name, schema); | ||
if (_type) { | ||
const data = _type.toBuffer(json); | ||
await _topic.publishMessage({ data }); | ||
} else { | ||
await _topic.publishMessage({ json }); | ||
} | ||
await _topic.publishMessage({ json }); | ||
} | ||
@@ -103,0 +92,0 @@ }; |
{ | ||
"name": "@sebspark/pubsub", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
23087
318