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

api-elements

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-elements - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

7

CHANGELOG.md
# API Elements (JavaScript) CHANGELOG
## 0.3.1 (2020-09-07)
### Bug Fixes
- Generating a value from an element will now prefer sample/default values for
objects which contain only undefined property values.
## 0.3.0 (2020-08-05)

@@ -4,0 +11,0 @@

8

lib/define-value-of.js

@@ -89,2 +89,3 @@ /* eslint-disable no-bitwise, no-underscore-dangle */

const isArrayElement = e => e instanceof ArrayElement;
const isObjectElement = e => e instanceof ObjectElement;

@@ -98,2 +99,5 @@ const hasSample = e => findFirstSample(e) !== null;

const isNonEmptyArrayElement = e => isArrayElement(e) && e.content && !e.isEmpty;
const isEmptyArray = e => isArrayElement(e) && e.content.every(isNoValuePrimitive);
const isObjectWithUndefinedValues = e => isObjectElement(e)
&& e.content.every(prop => prop.value === undefined || prop.value.content === undefined);

@@ -128,3 +132,3 @@

if (e.content && !(isArrayElement(e) && e.content.every(isNoValuePrimitive))) {
if (e.content && !isEmptyArray(e) && !isObjectWithUndefinedValues(e)) {
const result = f(e, opts, elements, 'content');

@@ -232,3 +236,3 @@

if (e instanceof ObjectElement) {
if (isObjectElement(e)) {
let result = {};

@@ -235,0 +239,0 @@

{
"name": "api-elements",
"version": "0.3.0",
"version": "0.3.1",
"description": "API Elements JavaScript",

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

},
"gitHead": "8c8c429fb233f691b4dd64dabc4cc01d765f06ef"
"gitHead": "d226305421ff42dfa30041568eb639a0755aa16b"
}
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