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

fury

Package Overview
Dependencies
Maintainers
6
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fury - npm Package Compare versions

Comparing version 3.0.0-beta.8 to 3.0.0-beta.9

LICENSE

14

CHANGELOG.md
# Fury Changelog
## 3.0.0-beta.9 (2019-02-26)
### Breaking
- Fury asynchronous APIs will no longer include both an error and a result
value. The APIs will now contain an error if the method could not proceed, or
a result. In the case of the `validate` and `parse` functions, these will
return a parse result with any error annotations upon a validation error and
will no longer include an error in the asynchronous callback.
### Enhancements
- Update minim to [0.23.0](https://github.com/refractproject/minim/releases/tag/v0.23.0).
## 3.0.0-beta.8 (2018-12-21)

@@ -4,0 +18,0 @@

44

lib/fury.js

@@ -39,3 +39,2 @@ const minimModule = require('minim');

*/
// eslint-disable-next-line class-methods-use-this
load(elements) {

@@ -62,10 +61,13 @@ return this.minim.fromRefract(elements);

if (!adapter) {
return this.parse({ source, mediaType, adapterOptions }, (err, result) => {
if (result && result.annotations.length > 0) {
return this.parse({ source, mediaType, adapterOptions }, (err, parseResult) => {
if (err) {
return done(err);
}
if (parseResult.annotations.length > 0) {
const { ParseResult } = this.minim.elements;
const parseResult = new ParseResult(result.annotations);
done(err, parseResult);
} else {
done(err, null);
return done(null, new ParseResult(parseResult.annotations));
}
return done(null, null);
});

@@ -80,8 +82,12 @@ }

return adapter.validate(options, (err, elements) => {
if (!elements || elements instanceof this.minim.Element) {
done(err, elements);
} else {
done(err, this.load(elements));
return adapter.validate(options, (err, parseResult) => {
if (err) {
return done(err);
}
if (parseResult && !(parseResult instanceof this.minim.Element)) {
return done(null, this.load(parseResult));
}
return done(null, parseResult);
});

@@ -112,8 +118,12 @@ }

return adapter.parse(options, (err, elements) => {
if (!elements || elements instanceof this.minim.Element) {
done(err, elements);
} else {
done(err, this.load(elements));
return adapter.parse(options, (err, parseResult) => {
if (err) {
return done(err);
}
if (!(parseResult instanceof this.minim.Element)) {
return done(null, this.load(parseResult));
}
return done(null, parseResult);
});

@@ -120,0 +130,0 @@ } catch (err) {

{
"name": "fury",
"version": "3.0.0-beta.8",
"version": "3.0.0-beta.9",
"description": "API Description SDK",

@@ -11,3 +11,4 @@ "author": "Apiary.io <support@apiary.io>",

"type": "git",
"url": "https://github.com/apiaryio/api-elements.js.git"
"url": "https://github.com/apiaryio/api-elements.js.git",
"directory": "packages/fury"
},

@@ -20,4 +21,4 @@ "scripts": {

"dependencies": {
"minim": "^0.22.1",
"minim-parse-result": "^0.10.1"
"minim": "^0.23.1",
"minim-parse-result": "^0.11.0"
},

@@ -24,0 +25,0 @@ "devDependencies": {

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