Comparing version 0.23.5 to 0.23.6
# Minim Changelog | ||
## 0.23.6 (2019-09-10) | ||
### Bug Fixes | ||
- Fixes a JSON 0.6 serialisation bug where httpRequest and similar array-based | ||
elements with undefined content would be serialised with undefined content | ||
instead of an empty array as content. | ||
## 0.23.5 (2019-07-02) | ||
@@ -4,0 +12,0 @@ |
@@ -68,2 +68,4 @@ const JSONSerialiser = require('./JSONSerialiser'); | ||
} | ||
} else if (this.shouldSerialiseContent(element, element.content) && element instanceof this.namespace.elements.Array) { | ||
payload.content = []; | ||
} | ||
@@ -75,6 +77,2 @@ | ||
shouldSerialiseContent(element, content) { | ||
if (content === undefined) { | ||
return false; | ||
} | ||
if (element.element === 'parseResult' || element.element === 'httpRequest' | ||
@@ -86,2 +84,6 @@ || element.element === 'httpResponse' || element.element === 'category' | ||
if (content === undefined) { | ||
return false; | ||
} | ||
if (Array.isArray(content) && content.length === 0) { | ||
@@ -88,0 +90,0 @@ return false; |
{ | ||
"name": "minim", | ||
"version": "0.23.5", | ||
"version": "0.23.6", | ||
"description": "A library for interacting with JSON through Refract elements", | ||
@@ -5,0 +5,0 @@ "main": "lib/minim.js", |
# Minim | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/refractproject/minim.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://travis-ci.org/refractproject/minim.svg?branch=master)](https://travis-ci.org/refractproject/minim) | ||
@@ -246,3 +244,3 @@ A library for interacting with [Refract elements](https://github.com/refractproject/refract-spec). | ||
stringElement.set('foobar'); | ||
var value = stringElement.get() // get() returns 'foobar' | ||
var value = stringElement.toValue() // toValue() returns 'foobar' | ||
``` | ||
@@ -261,3 +259,3 @@ | ||
numberElement.set(4); | ||
var value = numberElement.get() // get() returns 4 | ||
var value = numberElement.toValue() // toValue() returns 4 | ||
``` | ||
@@ -276,3 +274,3 @@ | ||
booleanElement.set(true); | ||
var value = booleanElement.get() // get() returns true | ||
var value = booleanElement.toValue() // toValue() returns true | ||
``` | ||
@@ -361,3 +359,3 @@ | ||
var newArray = arrayElement.filter(function(item) { | ||
return item.get() === 'a' | ||
return item.toValue() === 'a' | ||
}); // newArray.toValue() is now ['a'] | ||
@@ -364,0 +362,0 @@ ``` |
Sorry, the diff of this file is too big to display
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
616051
8515
734