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

asyncapi-converter

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asyncapi-converter - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

6

lib/index.js

@@ -200,8 +200,8 @@ const yaml = require('js-yaml');

function from1to2 (asyncapi1, options) {
let res = from1to2rc2(asyncapi1, options);
return from2rc2to2(res, options);
return from2rc2to2(from1to2rc2(asyncapi1, options), options);
}
function from2rc1to2 (asyncapi2rc1, options) {
const result = from2rc1to2rc2(res, options);
let result = from2rc1to2rc2(asyncapi2rc1, options);
if (!options.id) delete result.id;
result.asyncapi = '2.0.0';

@@ -208,0 +208,0 @@

{
"name": "asyncapi-converter",
"version": "0.4.0",
"version": "0.4.1",
"description": "Convert AsyncAPI documents from older to newer versions.",

@@ -5,0 +5,0 @@ "bin": {

@@ -77,2 +77,30 @@ const assert = require('assert');

it('should convert from 1.0.0 to 2.0.0', () => {
const input = fs.readFileSync(path.resolve(__dirname, 'input', '1.0.0', 'streetlights.yml'), 'utf8');
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.0.0', 'streetlights.yml'), 'utf8');
const result = convert(input, '2.0.0');
assert.strictEqual(output, result);
});
it('should convert from 1.1.0 to 2.0.0', () => {
const input = fs.readFileSync(path.resolve(__dirname, 'input', '1.1.0', 'streetlights.yml'), 'utf8');
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.0.0', 'streetlights.yml'), 'utf8');
const result = convert(input, '2.0.0');
assert.strictEqual(output, result);
});
it('should convert from 1.2.0 to 2.0.0', () => {
const input = fs.readFileSync(path.resolve(__dirname, 'input', '1.2.0', 'streetlights.yml'), 'utf8');
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.0.0', 'streetlights.yml'), 'utf8');
const result = convert(input, '2.0.0');
assert.strictEqual(output, result);
});
it('should convert from 2.0.0-rc1 to 2.0.0', () => {
const input = fs.readFileSync(path.resolve(__dirname, 'input', '2.0.0-rc1', 'streetlights.yml'), 'utf8');
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.0.0', 'streetlights.yml'), 'utf8');
const result = convert(input, '2.0.0');
assert.strictEqual(output, result);
});
it('should convert from 2.0.0-rc2 to 2.0.0', () => {

@@ -79,0 +107,0 @@ const input = fs.readFileSync(path.resolve(__dirname, 'input', '2.0.0-rc2', 'streetlights.yml'), 'utf8');

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